@@ -1494,19 +1494,17 @@ nfs_lookup_revalidate_dentry(struct inode *dir, struct dentry *dentry,
1494
1494
{
1495
1495
struct nfs_fh * fhandle ;
1496
1496
struct nfs_fattr * fattr ;
1497
- struct nfs4_label * label ;
1498
1497
unsigned long dir_verifier ;
1499
1498
int ret ;
1500
1499
1501
1500
ret = - ENOMEM ;
1502
1501
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 )
1506
1504
goto out ;
1507
1505
1508
1506
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 );
1510
1508
if (ret < 0 ) {
1511
1509
switch (ret ) {
1512
1510
case - ESTALE :
@@ -1525,7 +1523,7 @@ nfs_lookup_revalidate_dentry(struct inode *dir, struct dentry *dentry,
1525
1523
if (nfs_refresh_inode (inode , fattr ) < 0 )
1526
1524
goto out ;
1527
1525
1528
- nfs_setsecurity (inode , fattr , label );
1526
+ nfs_setsecurity (inode , fattr , fattr -> label );
1529
1527
nfs_set_verifier (dentry , dir_verifier );
1530
1528
1531
1529
/* set a readdirplus hint that we had a cache miss */
@@ -1534,7 +1532,6 @@ nfs_lookup_revalidate_dentry(struct inode *dir, struct dentry *dentry,
1534
1532
out :
1535
1533
nfs_free_fattr (fattr );
1536
1534
nfs_free_fhandle (fhandle );
1537
- nfs4_label_free (label );
1538
1535
1539
1536
/*
1540
1537
* 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
1754
1751
struct inode * inode = NULL ;
1755
1752
struct nfs_fh * fhandle = NULL ;
1756
1753
struct nfs_fattr * fattr = NULL ;
1757
- struct nfs4_label * label = NULL ;
1758
1754
unsigned long dir_verifier ;
1759
1755
int error ;
1760
1756
@@ -1773,27 +1769,23 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
1773
1769
1774
1770
res = ERR_PTR (- ENOMEM );
1775
1771
fhandle = nfs_alloc_fhandle ();
1776
- fattr = nfs_alloc_fattr ( );
1772
+ fattr = nfs_alloc_fattr_with_label ( NFS_SERVER ( dir ) );
1777
1773
if (fhandle == NULL || fattr == NULL )
1778
1774
goto out ;
1779
1775
1780
- label = nfs4_label_alloc (NFS_SERVER (dir ), GFP_NOWAIT );
1781
- if (IS_ERR (label ))
1782
- goto out ;
1783
-
1784
1776
dir_verifier = nfs_save_change_attribute (dir );
1785
1777
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 );
1787
1779
if (error == - ENOENT )
1788
1780
goto no_entry ;
1789
1781
if (error < 0 ) {
1790
1782
res = ERR_PTR (error );
1791
- goto out_label ;
1783
+ goto out ;
1792
1784
}
1793
- inode = nfs_fhget (dentry -> d_sb , fhandle , fattr , label );
1785
+ inode = nfs_fhget (dentry -> d_sb , fhandle , fattr , fattr -> label );
1794
1786
res = ERR_CAST (inode );
1795
1787
if (IS_ERR (res ))
1796
- goto out_label ;
1788
+ goto out ;
1797
1789
1798
1790
/* Notify readdir to use READDIRPLUS */
1799
1791
nfs_force_use_readdirplus (dir );
@@ -1802,14 +1794,12 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
1802
1794
res = d_splice_alias (inode , dentry );
1803
1795
if (res != NULL ) {
1804
1796
if (IS_ERR (res ))
1805
- goto out_label ;
1797
+ goto out ;
1806
1798
dentry = res ;
1807
1799
}
1808
1800
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 );
1812
1801
out :
1802
+ trace_nfs_lookup_exit (dir , dentry , flags , PTR_ERR_OR_ZERO (res ));
1813
1803
nfs_free_fattr (fattr );
1814
1804
nfs_free_fhandle (fhandle );
1815
1805
return res ;
@@ -2058,7 +2048,7 @@ nfs_add_or_obtain(struct dentry *dentry, struct nfs_fh *fhandle,
2058
2048
d_drop (dentry );
2059
2049
2060
2050
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 );
2062
2052
if (error )
2063
2053
goto out_error ;
2064
2054
}
0 commit comments