Whamcloud - gitweb
LU-8352 libcfs: Migrate file_inode() wrapper to lustre layer 82/21082/5
authorJames Simmons <uja.ornl@yahoo.com>
Wed, 20 Jul 2016 23:28:36 +0000 (19:28 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 1 Aug 2016 02:10:12 +0000 (02:10 +0000)
The file_inode() defined in libcfs will collide with the
same defination in compat-2.6.h from the OFED/Mellanox
stack. The easiest way to avoid this is move the file_inode
wrapper from libcfs linux-fs.h header to lustre_compat.h.
The header lustre_compat.h is only used in the lustre
layer so it wouldn't collide with compat-2.6.h.

Change-Id: I70502be0d824a2a1f9c538ae894ab8183961349b
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/21082
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Reviewed-by: Chris Horn <hornc@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/include/libcfs/linux/linux-fs.h
lustre/include/lustre_compat.h

index 4ab0590..680111d 100644 (file)
@@ -62,13 +62,6 @@ static inline struct dentry *file_dentry(const struct file *file)
 }
 #endif
 
-#ifndef HAVE_FILE_INODE
-static inline struct inode *file_inode(const struct file *file)
-{
-       return file->f_path.dentry->d_inode;
-}
-#endif
-
 #if defined(HAVE_FILE_FSYNC_4ARGS) || defined(HAVE_FILE_FSYNC_2ARGS)
 #define ll_vfs_fsync_range(fp, start, end, datasync) \
        vfs_fsync_range(fp, start, end, datasync)
index d37e5b3..10ba323 100644 (file)
@@ -351,6 +351,13 @@ static inline struct dentry *d_make_root(struct inode *root)
 # define set_file_inode(file, inode)
 #endif
 
+#ifndef HAVE_FILE_INODE
+static inline struct inode *file_inode(const struct file *file)
+{
+       return file->f_path.dentry->d_inode;
+}
+#endif
+
 #ifdef HAVE_OLDSIZE_TRUNCATE_PAGECACHE
 #define ll_truncate_pagecache(inode, size) truncate_pagecache(inode, 0, size)
 #else