aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-07-14 11:26:54 -0700
committerBrian Behlendorf <[email protected]>2010-07-14 11:40:55 -0700
commitf0ff89fc86873a96a3f60e86e1694775b664663e (patch)
tree21099dfd7e18a032ecb11d868be580eb61b1def3 /include
parent82b8c8fa64737edfb203156b245b48840139d2c1 (diff)
Linux 2.6.35 compat: filp_fsync() dropped 'stuct dentry *'
The prototype for filp_fsync() drop the unused argument 'stuct dentry *'. I've fixed this by adding the needed autoconf check and moving all of those filp related functions to file_compat.h. This will simplify handling any further API changes in the future.
Diffstat (limited to 'include')
-rw-r--r--include/linux/file_compat.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h
index d30e90356..b03373ebd 100644
--- a/include/linux/file_compat.h
+++ b/include/linux/file_compat.h
@@ -29,5 +29,32 @@
#include <linux/fdtable.h>
#endif
+static inline struct file *
+spl_filp_open(const char *name, int flags, int mode, int *err)
+{
+ struct file *filp = NULL;
+ int rc;
+
+ filp = filp_open(name, flags, mode);
+ if (IS_ERR(filp)) {
+ rc = PTR_ERR(filp);
+ if (err)
+ *err = rc;
+ filp = NULL;
+ }
+ return filp;
+}
+
+#define spl_filp_close(f) filp_close(f, NULL)
+#define spl_filp_poff(f) (&(f)->f_pos)
+#define spl_filp_write(fp, b, s, p) (fp)->f_op->write((fp), (b), (s), p)
+
+#ifdef HAVE_3ARGS_FILE_FSYNC
+#define spl_filp_fsync(fp, sync) (fp)->f_op->fsync((fp), \
+ (fp)->f_dentry, sync)
+#else
+#define spl_filp_fsync(fp, sync) (fp)->f_op->fsync((fp), sync)
+#endif
+
#endif /* SPL_FILE_COMPAT_H */