@@ -1494,19 +1494,17 @@ nfs_lookup_revalidate_dentry(struct inode *dir, struct dentry *dentry,
14941494{
14951495 struct nfs_fh * fhandle ;
14961496 struct nfs_fattr * fattr ;
1497- struct nfs4_label * label ;
14981497 unsigned long dir_verifier ;
14991498 int ret ;
15001499
15011500 ret = - ENOMEM ;
15021501 fhandle = nfs_alloc_fhandle ();
1503- fattr = nfs_alloc_fattr ();
1504- label = nfs4_label_alloc (NFS_SERVER (inode ), GFP_KERNEL );
1505- if (fhandle == NULL || fattr == NULL || IS_ERR (label ))
1502+ fattr = nfs_alloc_fattr_with_label (NFS_SERVER (inode ));
1503+ if (fhandle == NULL || fattr == NULL )
15061504 goto out ;
15071505
15081506 dir_verifier = nfs_save_change_attribute (dir );
1509- ret = NFS_PROTO (dir )-> lookup (dir , dentry , fhandle , fattr , label );
1507+ ret = NFS_PROTO (dir )-> lookup (dir , dentry , fhandle , fattr );
15101508 if (ret < 0 ) {
15111509 switch (ret ) {
15121510 case - ESTALE :
@@ -1525,7 +1523,7 @@ nfs_lookup_revalidate_dentry(struct inode *dir, struct dentry *dentry,
15251523 if (nfs_refresh_inode (inode , fattr ) < 0 )
15261524 goto out ;
15271525
1528- nfs_setsecurity (inode , fattr , label );
1526+ nfs_setsecurity (inode , fattr , fattr -> label );
15291527 nfs_set_verifier (dentry , dir_verifier );
15301528
15311529 /* set a readdirplus hint that we had a cache miss */
@@ -1534,7 +1532,6 @@ nfs_lookup_revalidate_dentry(struct inode *dir, struct dentry *dentry,
15341532out :
15351533 nfs_free_fattr (fattr );
15361534 nfs_free_fhandle (fhandle );
1537- nfs4_label_free (label );
15381535
15391536 /*
15401537 * If the lookup failed despite the dentry change attribute being
@@ -1754,7 +1751,6 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
17541751 struct inode * inode = NULL ;
17551752 struct nfs_fh * fhandle = NULL ;
17561753 struct nfs_fattr * fattr = NULL ;
1757- struct nfs4_label * label = NULL ;
17581754 unsigned long dir_verifier ;
17591755 int error ;
17601756
@@ -1773,27 +1769,23 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
17731769
17741770 res = ERR_PTR (- ENOMEM );
17751771 fhandle = nfs_alloc_fhandle ();
1776- fattr = nfs_alloc_fattr ( );
1772+ fattr = nfs_alloc_fattr_with_label ( NFS_SERVER ( dir ) );
17771773 if (fhandle == NULL || fattr == NULL )
17781774 goto out ;
17791775
1780- label = nfs4_label_alloc (NFS_SERVER (dir ), GFP_NOWAIT );
1781- if (IS_ERR (label ))
1782- goto out ;
1783-
17841776 dir_verifier = nfs_save_change_attribute (dir );
17851777 trace_nfs_lookup_enter (dir , dentry , flags );
1786- error = NFS_PROTO (dir )-> lookup (dir , dentry , fhandle , fattr , label );
1778+ error = NFS_PROTO (dir )-> lookup (dir , dentry , fhandle , fattr );
17871779 if (error == - ENOENT )
17881780 goto no_entry ;
17891781 if (error < 0 ) {
17901782 res = ERR_PTR (error );
1791- goto out_label ;
1783+ goto out ;
17921784 }
1793- inode = nfs_fhget (dentry -> d_sb , fhandle , fattr , label );
1785+ inode = nfs_fhget (dentry -> d_sb , fhandle , fattr , fattr -> label );
17941786 res = ERR_CAST (inode );
17951787 if (IS_ERR (res ))
1796- goto out_label ;
1788+ goto out ;
17971789
17981790 /* Notify readdir to use READDIRPLUS */
17991791 nfs_force_use_readdirplus (dir );
@@ -1802,14 +1794,12 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
18021794 res = d_splice_alias (inode , dentry );
18031795 if (res != NULL ) {
18041796 if (IS_ERR (res ))
1805- goto out_label ;
1797+ goto out ;
18061798 dentry = res ;
18071799 }
18081800 nfs_set_verifier (dentry , dir_verifier );
1809- out_label :
1810- trace_nfs_lookup_exit (dir , dentry , flags , PTR_ERR_OR_ZERO (res ));
1811- nfs4_label_free (label );
18121801out :
1802+ trace_nfs_lookup_exit (dir , dentry , flags , PTR_ERR_OR_ZERO (res ));
18131803 nfs_free_fattr (fattr );
18141804 nfs_free_fhandle (fhandle );
18151805 return res ;
@@ -2058,7 +2048,7 @@ nfs_add_or_obtain(struct dentry *dentry, struct nfs_fh *fhandle,
20582048 d_drop (dentry );
20592049
20602050 if (fhandle -> size == 0 ) {
2061- error = NFS_PROTO (dir )-> lookup (dir , dentry , fhandle , fattr , NULL );
2051+ error = NFS_PROTO (dir )-> lookup (dir , dentry , fhandle , fattr );
20622052 if (error )
20632053 goto out_error ;
20642054 }
0 commit comments