From: James Simmons Date: Wed, 20 Jul 2016 23:28:36 +0000 (-0400) Subject: LU-8352 libcfs: Migrate file_inode() wrapper to lustre layer X-Git-Tag: 2.8.56~16 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F82%2F21082%2F5;p=fs%2Flustre-release.git LU-8352 libcfs: Migrate file_inode() wrapper to lustre layer 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 Reviewed-on: http://review.whamcloud.com/21082 Reviewed-by: Bob Glossman Tested-by: Jenkins Reviewed-by: Chris Horn Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- diff --git a/libcfs/include/libcfs/linux/linux-fs.h b/libcfs/include/libcfs/linux/linux-fs.h index 4ab0590..680111d 100644 --- a/libcfs/include/libcfs/linux/linux-fs.h +++ b/libcfs/include/libcfs/linux/linux-fs.h @@ -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) diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h index d37e5b3..10ba323 100644 --- a/lustre/include/lustre_compat.h +++ b/lustre/include/lustre_compat.h @@ -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