Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-8176

Add file_dentry and file_inode wrappers

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • None
    • None
    • 9223372036854775807

    Description

      When upstream kernel moved to file->f_path.dentry and friends, a couple of very convenient wrappers were added:
      file_dentry(file) would return a dentry of the file
      file_inode(file) would return inode of the file.

      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;
      }
      

      Attachments

        Issue Links

          Activity

            People

              ys Yang Sheng
              green Oleg Drokin
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: