fix: backport 'Add 'kernel_read' wrapper for kernels < v4.14'
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 2 Oct 2020 20:10:05 +0000 (16:10 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 2 Oct 2020 20:17:41 +0000 (16:17 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I3b558a6a4b850054d5786bdf99e0849091c83eae

include/wrapper/fs.h [deleted file]
wrapper/fs.h [new file with mode: 0644]

diff --git a/include/wrapper/fs.h b/include/wrapper/fs.h
deleted file mode 100644 (file)
index f11c19f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
- *
- * wrapper/fs.h
- *
- * Copyright (C) 2020 Michael Jeanson <mjeanson@efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_FS_H
-#define _LTTNG_WRAPPER_FS_H
-
-#include <linux/fs.h>
-#include <lttng/kernel-version.h>
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
-
-static inline
-ssize_t lttng_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
-{
-       return kernel_read(file, buf, count, pos);
-}
-
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) */
-
-static inline
-ssize_t lttng_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
-{
-       ssize_t len;
-
-       len = kernel_read(file, *pos, buf, count);
-
-       /*
-        * Move 'pos' forward since it's passed by value in this
-        * implementation of 'kernel_read'.
-        */
-       if (len > 0)
-               (*pos) += len;
-
-       return len;
-}
-
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) */
-
-#endif /* _LTTNG_WRAPPER_FS_H */
diff --git a/wrapper/fs.h b/wrapper/fs.h
new file mode 100644 (file)
index 0000000..99697f8
--- /dev/null
@@ -0,0 +1,43 @@
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
+ * wrapper/fs.h
+ *
+ * Copyright (C) 2020 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#ifndef _LTTNG_WRAPPER_FS_H
+#define _LTTNG_WRAPPER_FS_H
+
+#include <linux/fs.h>
+#include <lttng-kernel-version.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
+
+static inline
+ssize_t lttng_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
+{
+       return kernel_read(file, buf, count, pos);
+}
+
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) */
+
+static inline
+ssize_t lttng_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
+{
+       ssize_t len;
+
+       len = kernel_read(file, *pos, buf, count);
+
+       /*
+        * Move 'pos' forward since it's passed by value in this
+        * implementation of 'kernel_read'.
+        */
+       if (len > 0)
+               (*pos) += len;
+
+       return len;
+}
+
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) */
+
+#endif /* _LTTNG_WRAPPER_FS_H */
This page took 0.027351 seconds and 4 git commands to generate.