@@ -1723,7 +1723,7 @@ EXPORT_SYMBOL(d_add_ci);
17231723 * Do the slow-case of the dentry name compare.
17241724 *
17251725 * Unlike the dentry_cmp() function, we need to atomically
1726- * load the name, length and inode information, so that the
1726+ * load the name and length information, so that the
17271727 * filesystem can rely on them, and can use the 'name' and
17281728 * 'len' information without worrying about walking off the
17291729 * end of memory etc.
@@ -1741,22 +1741,18 @@ enum slow_d_compare {
17411741
17421742static noinline enum slow_d_compare slow_dentry_cmp (
17431743 const struct dentry * parent ,
1744- struct inode * inode ,
17451744 struct dentry * dentry ,
17461745 unsigned int seq ,
17471746 const struct qstr * name )
17481747{
17491748 int tlen = dentry -> d_name .len ;
17501749 const char * tname = dentry -> d_name .name ;
1751- struct inode * i = dentry -> d_inode ;
17521750
17531751 if (read_seqcount_retry (& dentry -> d_seq , seq )) {
17541752 cpu_relax ();
17551753 return D_COMP_SEQRETRY ;
17561754 }
1757- if (parent -> d_op -> d_compare (parent , inode ,
1758- dentry , i ,
1759- tlen , tname , name ))
1755+ if (parent -> d_op -> d_compare (parent , dentry , tlen , tname , name ))
17601756 return D_COMP_NOMATCH ;
17611757 return D_COMP_OK ;
17621758}
@@ -1766,7 +1762,6 @@ static noinline enum slow_d_compare slow_dentry_cmp(
17661762 * @parent: parent dentry
17671763 * @name: qstr of name we wish to find
17681764 * @seqp: returns d_seq value at the point where the dentry was found
1769- * @inode: returns dentry->d_inode when the inode was found valid.
17701765 * Returns: dentry, or NULL
17711766 *
17721767 * __d_lookup_rcu is the dcache lookup function for rcu-walk name
@@ -1793,7 +1788,7 @@ static noinline enum slow_d_compare slow_dentry_cmp(
17931788 */
17941789struct dentry * __d_lookup_rcu (const struct dentry * parent ,
17951790 const struct qstr * name ,
1796- unsigned * seqp , struct inode * inode )
1791+ unsigned * seqp )
17971792{
17981793 u64 hashlen = name -> hash_len ;
17991794 const unsigned char * str = name -> name ;
@@ -1827,11 +1822,10 @@ struct dentry *__d_lookup_rcu(const struct dentry *parent,
18271822seqretry :
18281823 /*
18291824 * The dentry sequence count protects us from concurrent
1830- * renames, and thus protects inode, parent and name fields.
1825+ * renames, and thus protects parent and name fields.
18311826 *
18321827 * The caller must perform a seqcount check in order
1833- * to do anything useful with the returned dentry,
1834- * including using the 'd_inode' pointer.
1828+ * to do anything useful with the returned dentry.
18351829 *
18361830 * NOTE! We do a "raw" seqcount_begin here. That means that
18371831 * we don't wait for the sequence count to stabilize if it
@@ -1845,12 +1839,12 @@ struct dentry *__d_lookup_rcu(const struct dentry *parent,
18451839 continue ;
18461840 if (d_unhashed (dentry ))
18471841 continue ;
1848- * seqp = seq ;
18491842
18501843 if (unlikely (parent -> d_flags & DCACHE_OP_COMPARE )) {
18511844 if (dentry -> d_name .hash != hashlen_hash (hashlen ))
18521845 continue ;
1853- switch (slow_dentry_cmp (parent , inode , dentry , seq , name )) {
1846+ * seqp = seq ;
1847+ switch (slow_dentry_cmp (parent , dentry , seq , name )) {
18541848 case D_COMP_OK :
18551849 return dentry ;
18561850 case D_COMP_NOMATCH :
@@ -1862,6 +1856,7 @@ struct dentry *__d_lookup_rcu(const struct dentry *parent,
18621856
18631857 if (dentry -> d_name .hash_len != hashlen )
18641858 continue ;
1859+ * seqp = seq ;
18651860 if (!dentry_cmp (dentry , str , hashlen_len (hashlen )))
18661861 return dentry ;
18671862 }
@@ -1959,9 +1954,7 @@ struct dentry *__d_lookup(const struct dentry *parent, const struct qstr *name)
19591954 if (parent -> d_flags & DCACHE_OP_COMPARE ) {
19601955 int tlen = dentry -> d_name .len ;
19611956 const char * tname = dentry -> d_name .name ;
1962- if (parent -> d_op -> d_compare (parent , parent -> d_inode ,
1963- dentry , dentry -> d_inode ,
1964- tlen , tname , name ))
1957+ if (parent -> d_op -> d_compare (parent , dentry , tlen , tname , name ))
19651958 goto next ;
19661959 } else {
19671960 if (dentry -> d_name .len != len )
@@ -1998,7 +1991,7 @@ struct dentry *d_hash_and_lookup(struct dentry *dir, struct qstr *name)
19981991 */
19991992 name -> hash = full_name_hash (name -> name , name -> len );
20001993 if (dir -> d_flags & DCACHE_OP_HASH ) {
2001- int err = dir -> d_op -> d_hash (dir , dir -> d_inode , name );
1994+ int err = dir -> d_op -> d_hash (dir , name );
20021995 if (unlikely (err < 0 ))
20031996 return ERR_PTR (err );
20041997 }
0 commit comments