[LU-8176] Add file_dentry and file_inode wrappers Created: 20/May/16 Updated: 05/Jul/16 Resolved: 28/Jun/16 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.9.0 |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Oleg Drokin | Assignee: | Yang Sheng |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
|
When upstream kernel moved to file->f_path.dentry and friends, a couple of very convenient wrappers were added: Using those instead of the huge monstrosity we have now is probably better, just need to create compat wrappers for code that does not have it yet. static inline struct inode *file_inode(const struct file *f) { return f->f_inode; } static inline struct dentry *file_dentry(const struct file *file) { struct dentry *dentry = file->f_path.dentry; if (unlikely(dentry->d_flags & DCACHE_OP_REAL)) return dentry->d_op->d_real(dentry, file_inode(file)); else return dentry; } |
| Comments |
| Comment by Joseph Gmitter (Inactive) [ 24/May/16 ] |
|
Hi Yang Sheng, Would you be able to look into this one? Thanks. |
| Comment by Gerrit Updater [ 02/Jun/16 ] |
|
Yang Sheng (yang.sheng@intel.com) uploaded a new patch: http://review.whamcloud.com/20576 |
| Comment by Gerrit Updater [ 27/Jun/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/20576/ |
| Comment by Yang Sheng [ 28/Jun/16 ] |
|
Patch landed, Close ticket. |
| Comment by Chris Horn [ 05/Jul/16 ] |
|
This causes a build regression for us on SLES 11 SP3 against OFED 3.12-1 and OFED 3.18: [ 177s] In file included from /usr/src/packages/BUILD/cray-lustre/libcfs/include/libcfs/linux/libcfs.h:92, [ 177s] from /usr/src/packages/BUILD/cray-lustre/libcfs/include/libcfs/libcfs.h:43, [ 177s] from /usr/src/packages/BUILD/cray-lustre/lnet/klnds/gnilnd/gnilnd.h:67, [ 177s] from /usr/src/packages/BUILD/cray-lustre/lnet/klnds/gnilnd/gnilnd.c:25: [ 177s] /usr/src/packages/BUILD/cray-lustre/libcfs/include/libcfs/linux/linux-fs.h:66: error: conflicting types for 'backport_file_inode' [ 177s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/compat-3.12.h:16: error: previous definition of 'backport_file_inode' was here [ 177s] In file included from /usr/src/packages/BUILD/cray-lustre/libcfs/include/libcfs/linux/libcfs.h:92, [ 177s] from /usr/src/packages/BUILD/cray-lustre/libcfs/include/libcfs/libcfs.h:43, [ 177s] from /usr/src/packages/BUILD/cray-lustre/lnet/include/lnet/lib-lnet.h:48, [ 177s] from /usr/src/packages/BUILD/cray-lustre/lnet/lnet/api-ni.c:39: [ 177s] /usr/src/packages/BUILD/cray-lustre/libcfs/include/libcfs/linux/linux-fs.h:66: error: conflicting types for 'backport_file_inode' [ 177s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/compat-3.12.h:16: error: previous definition of 'backport_file_inode' was here |
| Comment by James A Simmons [ 05/Jul/16 ] |
|
Chris their is a fix for this under ticket |