From 0804103e520aa3df0c06516f1573bcb9d287db0d Mon Sep 17 00:00:00 2001 From: James Simmons Date: Wed, 20 Jul 2016 19:28:36 -0400 Subject: [PATCH] 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 --- libcfs/include/libcfs/linux/linux-fs.h | 7 ------- lustre/include/lustre_compat.h | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) 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 -- 1.8.3.1