diff options
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/export.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfs2acl.c | 8 | ||||
-rw-r--r-- | fs/nfsd/nfs3acl.c | 8 | ||||
-rw-r--r-- | fs/nfsd/nfs3proc.c | 6 | ||||
-rw-r--r-- | fs/nfsd/nfs3xdr.c | 16 | ||||
-rw-r--r-- | fs/nfsd/nfs4acl.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfs4proc.c | 12 | ||||
-rw-r--r-- | fs/nfsd/nfs4recover.c | 22 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 10 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.c | 20 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.h | 6 | ||||
-rw-r--r-- | fs/nfsd/nfsproc.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfsxdr.c | 2 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 62 | ||||
-rw-r--r-- | fs/nfsd/xdr4.h | 2 |
16 files changed, 95 insertions, 95 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 900c3ae94adc..f79521a59747 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -599,7 +599,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
599 | goto out4; | 599 | goto out4; |
600 | } | 600 | } |
601 | 601 | ||
602 | err = check_export(exp.ex_path.dentry->d_inode, &exp.ex_flags, | 602 | err = check_export(d_inode(exp.ex_path.dentry), &exp.ex_flags, |
603 | exp.ex_uuid); | 603 | exp.ex_uuid); |
604 | if (err) | 604 | if (err) |
605 | goto out4; | 605 | goto out4; |
@@ -890,7 +890,7 @@ exp_rootfh(struct net *net, struct auth_domain *clp, char *name, | |||
890 | printk("nfsd: exp_rootfh path not found %s", name); | 890 | printk("nfsd: exp_rootfh path not found %s", name); |
891 | return err; | 891 | return err; |
892 | } | 892 | } |
893 | inode = path.dentry->d_inode; | 893 | inode = d_inode(path.dentry); |
894 | 894 | ||
895 | dprintk("nfsd: exp_rootfh(%s [%p] %s:%s/%ld)\n", | 895 | dprintk("nfsd: exp_rootfh(%s [%p] %s:%s/%ld)\n", |
896 | name, path.dentry, clp->name, | 896 | name, path.dentry, clp->name, |
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c index ac54ea60b3f6..d54701f6dc78 100644 --- a/fs/nfsd/nfs2acl.c +++ b/fs/nfsd/nfs2acl.c | |||
@@ -42,7 +42,7 @@ static __be32 nfsacld_proc_getacl(struct svc_rqst * rqstp, | |||
42 | if (nfserr) | 42 | if (nfserr) |
43 | RETURN_STATUS(nfserr); | 43 | RETURN_STATUS(nfserr); |
44 | 44 | ||
45 | inode = fh->fh_dentry->d_inode; | 45 | inode = d_inode(fh->fh_dentry); |
46 | 46 | ||
47 | if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT)) | 47 | if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT)) |
48 | RETURN_STATUS(nfserr_inval); | 48 | RETURN_STATUS(nfserr_inval); |
@@ -103,7 +103,7 @@ static __be32 nfsacld_proc_setacl(struct svc_rqst * rqstp, | |||
103 | if (nfserr) | 103 | if (nfserr) |
104 | goto out; | 104 | goto out; |
105 | 105 | ||
106 | inode = fh->fh_dentry->d_inode; | 106 | inode = d_inode(fh->fh_dentry); |
107 | if (!IS_POSIXACL(inode) || !inode->i_op->set_acl) { | 107 | if (!IS_POSIXACL(inode) || !inode->i_op->set_acl) { |
108 | error = -EOPNOTSUPP; | 108 | error = -EOPNOTSUPP; |
109 | goto out_errno; | 109 | goto out_errno; |
@@ -266,9 +266,9 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p, | |||
266 | * nfsd_dispatch actually ensures the following cannot happen. | 266 | * nfsd_dispatch actually ensures the following cannot happen. |
267 | * However, it seems fragile to depend on that. | 267 | * However, it seems fragile to depend on that. |
268 | */ | 268 | */ |
269 | if (dentry == NULL || dentry->d_inode == NULL) | 269 | if (dentry == NULL || d_really_is_negative(dentry)) |
270 | return 0; | 270 | return 0; |
271 | inode = dentry->d_inode; | 271 | inode = d_inode(dentry); |
272 | 272 | ||
273 | p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat); | 273 | p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat); |
274 | *p++ = htonl(resp->mask); | 274 | *p++ = htonl(resp->mask); |
diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c index 34cbbab6abd7..882b1a14bc3e 100644 --- a/fs/nfsd/nfs3acl.c +++ b/fs/nfsd/nfs3acl.c | |||
@@ -39,7 +39,7 @@ static __be32 nfsd3_proc_getacl(struct svc_rqst * rqstp, | |||
39 | if (nfserr) | 39 | if (nfserr) |
40 | RETURN_STATUS(nfserr); | 40 | RETURN_STATUS(nfserr); |
41 | 41 | ||
42 | inode = fh->fh_dentry->d_inode; | 42 | inode = d_inode(fh->fh_dentry); |
43 | 43 | ||
44 | if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT)) | 44 | if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT)) |
45 | RETURN_STATUS(nfserr_inval); | 45 | RETURN_STATUS(nfserr_inval); |
@@ -94,7 +94,7 @@ static __be32 nfsd3_proc_setacl(struct svc_rqst * rqstp, | |||
94 | if (nfserr) | 94 | if (nfserr) |
95 | goto out; | 95 | goto out; |
96 | 96 | ||
97 | inode = fh->fh_dentry->d_inode; | 97 | inode = d_inode(fh->fh_dentry); |
98 | if (!IS_POSIXACL(inode) || !inode->i_op->set_acl) { | 98 | if (!IS_POSIXACL(inode) || !inode->i_op->set_acl) { |
99 | error = -EOPNOTSUPP; | 99 | error = -EOPNOTSUPP; |
100 | goto out_errno; | 100 | goto out_errno; |
@@ -174,8 +174,8 @@ static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p, | |||
174 | struct dentry *dentry = resp->fh.fh_dentry; | 174 | struct dentry *dentry = resp->fh.fh_dentry; |
175 | 175 | ||
176 | p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh); | 176 | p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh); |
177 | if (resp->status == 0 && dentry && dentry->d_inode) { | 177 | if (resp->status == 0 && dentry && d_really_is_positive(dentry)) { |
178 | struct inode *inode = dentry->d_inode; | 178 | struct inode *inode = d_inode(dentry); |
179 | struct kvec *head = rqstp->rq_res.head; | 179 | struct kvec *head = rqstp->rq_res.head; |
180 | unsigned int base; | 180 | unsigned int base; |
181 | int n; | 181 | int n; |
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c index 12f2aab4f614..7b755b7f785c 100644 --- a/fs/nfsd/nfs3proc.c +++ b/fs/nfsd/nfs3proc.c | |||
@@ -166,7 +166,7 @@ nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp, | |||
166 | rqstp->rq_vec, argp->vlen, | 166 | rqstp->rq_vec, argp->vlen, |
167 | &resp->count); | 167 | &resp->count); |
168 | if (nfserr == 0) { | 168 | if (nfserr == 0) { |
169 | struct inode *inode = resp->fh.fh_dentry->d_inode; | 169 | struct inode *inode = d_inode(resp->fh.fh_dentry); |
170 | 170 | ||
171 | resp->eof = (argp->offset + resp->count) >= inode->i_size; | 171 | resp->eof = (argp->offset + resp->count) >= inode->i_size; |
172 | } | 172 | } |
@@ -551,7 +551,7 @@ nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle *argp, | |||
551 | * different read/write sizes for file systems known to have | 551 | * different read/write sizes for file systems known to have |
552 | * problems with large blocks */ | 552 | * problems with large blocks */ |
553 | if (nfserr == 0) { | 553 | if (nfserr == 0) { |
554 | struct super_block *sb = argp->fh.fh_dentry->d_inode->i_sb; | 554 | struct super_block *sb = d_inode(argp->fh.fh_dentry)->i_sb; |
555 | 555 | ||
556 | /* Note that we don't care for remote fs's here */ | 556 | /* Note that we don't care for remote fs's here */ |
557 | if (sb->s_magic == MSDOS_SUPER_MAGIC) { | 557 | if (sb->s_magic == MSDOS_SUPER_MAGIC) { |
@@ -587,7 +587,7 @@ nfsd3_proc_pathconf(struct svc_rqst * rqstp, struct nfsd_fhandle *argp, | |||
587 | nfserr = fh_verify(rqstp, &argp->fh, 0, NFSD_MAY_NOP); | 587 | nfserr = fh_verify(rqstp, &argp->fh, 0, NFSD_MAY_NOP); |
588 | 588 | ||
589 | if (nfserr == 0) { | 589 | if (nfserr == 0) { |
590 | struct super_block *sb = argp->fh.fh_dentry->d_inode->i_sb; | 590 | struct super_block *sb = d_inode(argp->fh.fh_dentry)->i_sb; |
591 | 591 | ||
592 | /* Note that we don't care for remote fs's here */ | 592 | /* Note that we don't care for remote fs's here */ |
593 | switch (sb->s_magic) { | 593 | switch (sb->s_magic) { |
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 39c5eb3ad33a..e4b2b4322553 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c | |||
@@ -146,7 +146,7 @@ static __be32 *encode_fsid(__be32 *p, struct svc_fh *fhp) | |||
146 | default: | 146 | default: |
147 | case FSIDSOURCE_DEV: | 147 | case FSIDSOURCE_DEV: |
148 | p = xdr_encode_hyper(p, (u64)huge_encode_dev | 148 | p = xdr_encode_hyper(p, (u64)huge_encode_dev |
149 | (fhp->fh_dentry->d_inode->i_sb->s_dev)); | 149 | (d_inode(fhp->fh_dentry)->i_sb->s_dev)); |
150 | break; | 150 | break; |
151 | case FSIDSOURCE_FSID: | 151 | case FSIDSOURCE_FSID: |
152 | p = xdr_encode_hyper(p, (u64) fhp->fh_export->ex_fsid); | 152 | p = xdr_encode_hyper(p, (u64) fhp->fh_export->ex_fsid); |
@@ -203,14 +203,14 @@ static __be32 * | |||
203 | encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp) | 203 | encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp) |
204 | { | 204 | { |
205 | struct dentry *dentry = fhp->fh_dentry; | 205 | struct dentry *dentry = fhp->fh_dentry; |
206 | if (dentry && dentry->d_inode) { | 206 | if (dentry && d_really_is_positive(dentry)) { |
207 | __be32 err; | 207 | __be32 err; |
208 | struct kstat stat; | 208 | struct kstat stat; |
209 | 209 | ||
210 | err = fh_getattr(fhp, &stat); | 210 | err = fh_getattr(fhp, &stat); |
211 | if (!err) { | 211 | if (!err) { |
212 | *p++ = xdr_one; /* attributes follow */ | 212 | *p++ = xdr_one; /* attributes follow */ |
213 | lease_get_mtime(dentry->d_inode, &stat.mtime); | 213 | lease_get_mtime(d_inode(dentry), &stat.mtime); |
214 | return encode_fattr3(rqstp, p, fhp, &stat); | 214 | return encode_fattr3(rqstp, p, fhp, &stat); |
215 | } | 215 | } |
216 | } | 216 | } |
@@ -233,7 +233,7 @@ encode_wcc_data(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp) | |||
233 | { | 233 | { |
234 | struct dentry *dentry = fhp->fh_dentry; | 234 | struct dentry *dentry = fhp->fh_dentry; |
235 | 235 | ||
236 | if (dentry && dentry->d_inode && fhp->fh_post_saved) { | 236 | if (dentry && d_really_is_positive(dentry) && fhp->fh_post_saved) { |
237 | if (fhp->fh_pre_saved) { | 237 | if (fhp->fh_pre_saved) { |
238 | *p++ = xdr_one; | 238 | *p++ = xdr_one; |
239 | p = xdr_encode_hyper(p, (u64) fhp->fh_pre_size); | 239 | p = xdr_encode_hyper(p, (u64) fhp->fh_pre_size); |
@@ -260,11 +260,11 @@ void fill_post_wcc(struct svc_fh *fhp) | |||
260 | printk("nfsd: inode locked twice during operation.\n"); | 260 | printk("nfsd: inode locked twice during operation.\n"); |
261 | 261 | ||
262 | err = fh_getattr(fhp, &fhp->fh_post_attr); | 262 | err = fh_getattr(fhp, &fhp->fh_post_attr); |
263 | fhp->fh_post_change = fhp->fh_dentry->d_inode->i_version; | 263 | fhp->fh_post_change = d_inode(fhp->fh_dentry)->i_version; |
264 | if (err) { | 264 | if (err) { |
265 | fhp->fh_post_saved = 0; | 265 | fhp->fh_post_saved = 0; |
266 | /* Grab the ctime anyway - set_change_info might use it */ | 266 | /* Grab the ctime anyway - set_change_info might use it */ |
267 | fhp->fh_post_attr.ctime = fhp->fh_dentry->d_inode->i_ctime; | 267 | fhp->fh_post_attr.ctime = d_inode(fhp->fh_dentry)->i_ctime; |
268 | } else | 268 | } else |
269 | fhp->fh_post_saved = 1; | 269 | fhp->fh_post_saved = 1; |
270 | } | 270 | } |
@@ -628,7 +628,7 @@ nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p, | |||
628 | struct nfsd3_attrstat *resp) | 628 | struct nfsd3_attrstat *resp) |
629 | { | 629 | { |
630 | if (resp->status == 0) { | 630 | if (resp->status == 0) { |
631 | lease_get_mtime(resp->fh.fh_dentry->d_inode, | 631 | lease_get_mtime(d_inode(resp->fh.fh_dentry), |
632 | &resp->stat.mtime); | 632 | &resp->stat.mtime); |
633 | p = encode_fattr3(rqstp, p, &resp->fh, &resp->stat); | 633 | p = encode_fattr3(rqstp, p, &resp->fh, &resp->stat); |
634 | } | 634 | } |
@@ -828,7 +828,7 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, | |||
828 | return rv; | 828 | return rv; |
829 | if (d_mountpoint(dchild)) | 829 | if (d_mountpoint(dchild)) |
830 | goto out; | 830 | goto out; |
831 | if (!dchild->d_inode) | 831 | if (d_really_is_negative(dchild)) |
832 | goto out; | 832 | goto out; |
833 | rv = fh_compose(fhp, exp, dchild, &cd->fh); | 833 | rv = fh_compose(fhp, exp, dchild, &cd->fh); |
834 | out: | 834 | out: |
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c index eaf4605a4b9e..67242bf7c6cc 100644 --- a/fs/nfsd/nfs4acl.c +++ b/fs/nfsd/nfs4acl.c | |||
@@ -139,7 +139,7 @@ int | |||
139 | nfsd4_get_nfs4_acl(struct svc_rqst *rqstp, struct dentry *dentry, | 139 | nfsd4_get_nfs4_acl(struct svc_rqst *rqstp, struct dentry *dentry, |
140 | struct nfs4_acl **acl) | 140 | struct nfs4_acl **acl) |
141 | { | 141 | { |
142 | struct inode *inode = dentry->d_inode; | 142 | struct inode *inode = d_inode(dentry); |
143 | int error = 0; | 143 | int error = 0; |
144 | struct posix_acl *pacl = NULL, *dpacl = NULL; | 144 | struct posix_acl *pacl = NULL, *dpacl = NULL; |
145 | unsigned int flags = 0; | 145 | unsigned int flags = 0; |
@@ -780,7 +780,7 @@ nfsd4_set_nfs4_acl(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
780 | return error; | 780 | return error; |
781 | 781 | ||
782 | dentry = fhp->fh_dentry; | 782 | dentry = fhp->fh_dentry; |
783 | inode = dentry->d_inode; | 783 | inode = d_inode(dentry); |
784 | 784 | ||
785 | if (!inode->i_op->set_acl || !IS_POSIXACL(inode)) | 785 | if (!inode->i_op->set_acl || !IS_POSIXACL(inode)) |
786 | return nfserr_attrnotsupp; | 786 | return nfserr_attrnotsupp; |
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 4a8314f08a0e..864e2003e8de 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -52,7 +52,7 @@ | |||
52 | static inline void | 52 | static inline void |
53 | nfsd4_security_inode_setsecctx(struct svc_fh *resfh, struct xdr_netobj *label, u32 *bmval) | 53 | nfsd4_security_inode_setsecctx(struct svc_fh *resfh, struct xdr_netobj *label, u32 *bmval) |
54 | { | 54 | { |
55 | struct inode *inode = resfh->fh_dentry->d_inode; | 55 | struct inode *inode = d_inode(resfh->fh_dentry); |
56 | int status; | 56 | int status; |
57 | 57 | ||
58 | mutex_lock(&inode->i_mutex); | 58 | mutex_lock(&inode->i_mutex); |
@@ -110,7 +110,7 @@ check_attr_support(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
110 | * in current environment or not. | 110 | * in current environment or not. |
111 | */ | 111 | */ |
112 | if (bmval[0] & FATTR4_WORD0_ACL) { | 112 | if (bmval[0] & FATTR4_WORD0_ACL) { |
113 | if (!IS_POSIXACL(dentry->d_inode)) | 113 | if (!IS_POSIXACL(d_inode(dentry))) |
114 | return nfserr_attrnotsupp; | 114 | return nfserr_attrnotsupp; |
115 | } | 115 | } |
116 | 116 | ||
@@ -209,7 +209,7 @@ do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfs | |||
209 | 209 | ||
210 | static __be32 nfsd_check_obj_isreg(struct svc_fh *fh) | 210 | static __be32 nfsd_check_obj_isreg(struct svc_fh *fh) |
211 | { | 211 | { |
212 | umode_t mode = fh->fh_dentry->d_inode->i_mode; | 212 | umode_t mode = d_inode(fh->fh_dentry)->i_mode; |
213 | 213 | ||
214 | if (S_ISREG(mode)) | 214 | if (S_ISREG(mode)) |
215 | return nfs_ok; | 215 | return nfs_ok; |
@@ -881,7 +881,7 @@ nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
881 | &exp, &dentry); | 881 | &exp, &dentry); |
882 | if (err) | 882 | if (err) |
883 | return err; | 883 | return err; |
884 | if (dentry->d_inode == NULL) { | 884 | if (d_really_is_negative(dentry)) { |
885 | exp_put(exp); | 885 | exp_put(exp); |
886 | err = nfserr_noent; | 886 | err = nfserr_noent; |
887 | } else | 887 | } else |
@@ -1312,7 +1312,7 @@ nfsd4_layoutget(struct svc_rqst *rqstp, | |||
1312 | if (atomic_read(&ls->ls_stid.sc_file->fi_lo_recalls)) | 1312 | if (atomic_read(&ls->ls_stid.sc_file->fi_lo_recalls)) |
1313 | goto out_put_stid; | 1313 | goto out_put_stid; |
1314 | 1314 | ||
1315 | nfserr = ops->proc_layoutget(current_fh->fh_dentry->d_inode, | 1315 | nfserr = ops->proc_layoutget(d_inode(current_fh->fh_dentry), |
1316 | current_fh, lgp); | 1316 | current_fh, lgp); |
1317 | if (nfserr) | 1317 | if (nfserr) |
1318 | goto out_put_stid; | 1318 | goto out_put_stid; |
@@ -1346,7 +1346,7 @@ nfsd4_layoutcommit(struct svc_rqst *rqstp, | |||
1346 | ops = nfsd4_layout_verify(current_fh->fh_export, lcp->lc_layout_type); | 1346 | ops = nfsd4_layout_verify(current_fh->fh_export, lcp->lc_layout_type); |
1347 | if (!ops) | 1347 | if (!ops) |
1348 | goto out; | 1348 | goto out; |
1349 | inode = current_fh->fh_dentry->d_inode; | 1349 | inode = d_inode(current_fh->fh_dentry); |
1350 | 1350 | ||
1351 | nfserr = nfserr_inval; | 1351 | nfserr = nfserr_inval; |
1352 | if (new_size <= seg->offset) { | 1352 | if (new_size <= seg->offset) { |
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 1c307f02baa8..d88ea7b9a85c 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c | |||
@@ -192,14 +192,14 @@ nfsd4_create_clid_dir(struct nfs4_client *clp) | |||
192 | 192 | ||
193 | dir = nn->rec_file->f_path.dentry; | 193 | dir = nn->rec_file->f_path.dentry; |
194 | /* lock the parent */ | 194 | /* lock the parent */ |
195 | mutex_lock(&dir->d_inode->i_mutex); | 195 | mutex_lock(&d_inode(dir)->i_mutex); |
196 | 196 | ||
197 | dentry = lookup_one_len(dname, dir, HEXDIR_LEN-1); | 197 | dentry = lookup_one_len(dname, dir, HEXDIR_LEN-1); |
198 | if (IS_ERR(dentry)) { | 198 | if (IS_ERR(dentry)) { |
199 | status = PTR_ERR(dentry); | 199 | status = PTR_ERR(dentry); |
200 | goto out_unlock; | 200 | goto out_unlock; |
201 | } | 201 | } |
202 | if (dentry->d_inode) | 202 | if (d_really_is_positive(dentry)) |
203 | /* | 203 | /* |
204 | * In the 4.1 case, where we're called from | 204 | * In the 4.1 case, where we're called from |
205 | * reclaim_complete(), records from the previous reboot | 205 | * reclaim_complete(), records from the previous reboot |
@@ -209,11 +209,11 @@ nfsd4_create_clid_dir(struct nfs4_client *clp) | |||
209 | * as well be forgiving and just succeed silently. | 209 | * as well be forgiving and just succeed silently. |
210 | */ | 210 | */ |
211 | goto out_put; | 211 | goto out_put; |
212 | status = vfs_mkdir(dir->d_inode, dentry, S_IRWXU); | 212 | status = vfs_mkdir(d_inode(dir), dentry, S_IRWXU); |
213 | out_put: | 213 | out_put: |
214 | dput(dentry); | 214 | dput(dentry); |
215 | out_unlock: | 215 | out_unlock: |
216 | mutex_unlock(&dir->d_inode->i_mutex); | 216 | mutex_unlock(&d_inode(dir)->i_mutex); |
217 | if (status == 0) { | 217 | if (status == 0) { |
218 | if (nn->in_grace) { | 218 | if (nn->in_grace) { |
219 | crp = nfs4_client_to_reclaim(dname, nn); | 219 | crp = nfs4_client_to_reclaim(dname, nn); |
@@ -285,7 +285,7 @@ nfsd4_list_rec_dir(recdir_func *f, struct nfsd_net *nn) | |||
285 | } | 285 | } |
286 | 286 | ||
287 | status = iterate_dir(nn->rec_file, &ctx.ctx); | 287 | status = iterate_dir(nn->rec_file, &ctx.ctx); |
288 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); | 288 | mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT); |
289 | while (!list_empty(&ctx.names)) { | 289 | while (!list_empty(&ctx.names)) { |
290 | struct name_list *entry; | 290 | struct name_list *entry; |
291 | entry = list_entry(ctx.names.next, struct name_list, list); | 291 | entry = list_entry(ctx.names.next, struct name_list, list); |
@@ -302,7 +302,7 @@ nfsd4_list_rec_dir(recdir_func *f, struct nfsd_net *nn) | |||
302 | list_del(&entry->list); | 302 | list_del(&entry->list); |
303 | kfree(entry); | 303 | kfree(entry); |
304 | } | 304 | } |
305 | mutex_unlock(&dir->d_inode->i_mutex); | 305 | mutex_unlock(&d_inode(dir)->i_mutex); |
306 | nfs4_reset_creds(original_cred); | 306 | nfs4_reset_creds(original_cred); |
307 | return status; | 307 | return status; |
308 | } | 308 | } |
@@ -316,20 +316,20 @@ nfsd4_unlink_clid_dir(char *name, int namlen, struct nfsd_net *nn) | |||
316 | dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name); | 316 | dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name); |
317 | 317 | ||
318 | dir = nn->rec_file->f_path.dentry; | 318 | dir = nn->rec_file->f_path.dentry; |
319 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); | 319 | mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT); |
320 | dentry = lookup_one_len(name, dir, namlen); | 320 | dentry = lookup_one_len(name, dir, namlen); |
321 | if (IS_ERR(dentry)) { | 321 | if (IS_ERR(dentry)) { |
322 | status = PTR_ERR(dentry); | 322 | status = PTR_ERR(dentry); |
323 | goto out_unlock; | 323 | goto out_unlock; |
324 | } | 324 | } |
325 | status = -ENOENT; | 325 | status = -ENOENT; |
326 | if (!dentry->d_inode) | 326 | if (d_really_is_negative(dentry)) |
327 | goto out; | 327 | goto out; |
328 | status = vfs_rmdir(dir->d_inode, dentry); | 328 | status = vfs_rmdir(d_inode(dir), dentry); |
329 | out: | 329 | out: |
330 | dput(dentry); | 330 | dput(dentry); |
331 | out_unlock: | 331 | out_unlock: |
332 | mutex_unlock(&dir->d_inode->i_mutex); | 332 | mutex_unlock(&d_inode(dir)->i_mutex); |
333 | return status; | 333 | return status; |
334 | } | 334 | } |
335 | 335 | ||
@@ -385,7 +385,7 @@ purge_old(struct dentry *parent, struct dentry *child, struct nfsd_net *nn) | |||
385 | if (nfs4_has_reclaimed_state(child->d_name.name, nn)) | 385 | if (nfs4_has_reclaimed_state(child->d_name.name, nn)) |
386 | return 0; | 386 | return 0; |
387 | 387 | ||
388 | status = vfs_rmdir(parent->d_inode, child); | 388 | status = vfs_rmdir(d_inode(parent), child); |
389 | if (status) | 389 | if (status) |
390 | printk("failed to remove client recovery directory %pd\n", | 390 | printk("failed to remove client recovery directory %pd\n", |
391 | child); | 391 | child); |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d42786ee39af..38f2d7abe3a7 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -4472,7 +4472,7 @@ nfs4_preprocess_stateid_op(struct net *net, struct nfsd4_compound_state *cstate, | |||
4472 | struct nfs4_ol_stateid *stp = NULL; | 4472 | struct nfs4_ol_stateid *stp = NULL; |
4473 | struct nfs4_delegation *dp = NULL; | 4473 | struct nfs4_delegation *dp = NULL; |
4474 | struct svc_fh *current_fh = &cstate->current_fh; | 4474 | struct svc_fh *current_fh = &cstate->current_fh; |
4475 | struct inode *ino = current_fh->fh_dentry->d_inode; | 4475 | struct inode *ino = d_inode(current_fh->fh_dentry); |
4476 | struct nfsd_net *nn = net_generic(net, nfsd_net_id); | 4476 | struct nfsd_net *nn = net_generic(net, nfsd_net_id); |
4477 | struct file *file = NULL; | 4477 | struct file *file = NULL; |
4478 | __be32 status; | 4478 | __be32 status; |
@@ -5170,7 +5170,7 @@ lookup_or_create_lock_state(struct nfsd4_compound_state *cstate, | |||
5170 | struct nfs4_file *fi = ost->st_stid.sc_file; | 5170 | struct nfs4_file *fi = ost->st_stid.sc_file; |
5171 | struct nfs4_openowner *oo = openowner(ost->st_stateowner); | 5171 | struct nfs4_openowner *oo = openowner(ost->st_stateowner); |
5172 | struct nfs4_client *cl = oo->oo_owner.so_client; | 5172 | struct nfs4_client *cl = oo->oo_owner.so_client; |
5173 | struct inode *inode = cstate->current_fh.fh_dentry->d_inode; | 5173 | struct inode *inode = d_inode(cstate->current_fh.fh_dentry); |
5174 | struct nfs4_lockowner *lo; | 5174 | struct nfs4_lockowner *lo; |
5175 | unsigned int strhashval; | 5175 | unsigned int strhashval; |
5176 | 5176 | ||
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index a45032ce7b80..158badf945df 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -2292,7 +2292,7 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, | |||
2292 | #ifdef CONFIG_NFSD_V4_SECURITY_LABEL | 2292 | #ifdef CONFIG_NFSD_V4_SECURITY_LABEL |
2293 | if ((bmval[2] & FATTR4_WORD2_SECURITY_LABEL) || | 2293 | if ((bmval[2] & FATTR4_WORD2_SECURITY_LABEL) || |
2294 | bmval[0] & FATTR4_WORD0_SUPPORTED_ATTRS) { | 2294 | bmval[0] & FATTR4_WORD0_SUPPORTED_ATTRS) { |
2295 | err = security_inode_getsecctx(dentry->d_inode, | 2295 | err = security_inode_getsecctx(d_inode(dentry), |
2296 | &context, &contextlen); | 2296 | &context, &contextlen); |
2297 | contextsupport = (err == 0); | 2297 | contextsupport = (err == 0); |
2298 | if (bmval2 & FATTR4_WORD2_SECURITY_LABEL) { | 2298 | if (bmval2 & FATTR4_WORD2_SECURITY_LABEL) { |
@@ -2384,7 +2384,7 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, | |||
2384 | p = xdr_reserve_space(xdr, 8); | 2384 | p = xdr_reserve_space(xdr, 8); |
2385 | if (!p) | 2385 | if (!p) |
2386 | goto out_resource; | 2386 | goto out_resource; |
2387 | p = encode_change(p, &stat, dentry->d_inode); | 2387 | p = encode_change(p, &stat, d_inode(dentry)); |
2388 | } | 2388 | } |
2389 | if (bmval0 & FATTR4_WORD0_SIZE) { | 2389 | if (bmval0 & FATTR4_WORD0_SIZE) { |
2390 | p = xdr_reserve_space(xdr, 8); | 2390 | p = xdr_reserve_space(xdr, 8); |
@@ -2807,7 +2807,7 @@ nfsd4_encode_dirent_fattr(struct xdr_stream *xdr, struct nfsd4_readdir *cd, | |||
2807 | dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen); | 2807 | dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen); |
2808 | if (IS_ERR(dentry)) | 2808 | if (IS_ERR(dentry)) |
2809 | return nfserrno(PTR_ERR(dentry)); | 2809 | return nfserrno(PTR_ERR(dentry)); |
2810 | if (!dentry->d_inode) { | 2810 | if (d_really_is_negative(dentry)) { |
2811 | /* | 2811 | /* |
2812 | * nfsd_buffered_readdir drops the i_mutex between | 2812 | * nfsd_buffered_readdir drops the i_mutex between |
2813 | * readdir and calling this callback, leaving a window | 2813 | * readdir and calling this callback, leaving a window |
@@ -3324,7 +3324,7 @@ static __be32 nfsd4_encode_splice_read( | |||
3324 | } | 3324 | } |
3325 | 3325 | ||
3326 | eof = (read->rd_offset + maxcount >= | 3326 | eof = (read->rd_offset + maxcount >= |
3327 | read->rd_fhp->fh_dentry->d_inode->i_size); | 3327 | d_inode(read->rd_fhp->fh_dentry)->i_size); |
3328 | 3328 | ||
3329 | *(p++) = htonl(eof); | 3329 | *(p++) = htonl(eof); |
3330 | *(p++) = htonl(maxcount); | 3330 | *(p++) = htonl(maxcount); |
@@ -3401,7 +3401,7 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, | |||
3401 | xdr_truncate_encode(xdr, starting_len + 8 + ((maxcount+3)&~3)); | 3401 | xdr_truncate_encode(xdr, starting_len + 8 + ((maxcount+3)&~3)); |
3402 | 3402 | ||
3403 | eof = (read->rd_offset + maxcount >= | 3403 | eof = (read->rd_offset + maxcount >= |
3404 | read->rd_fhp->fh_dentry->d_inode->i_size); | 3404 | d_inode(read->rd_fhp->fh_dentry)->i_size); |
3405 | 3405 | ||
3406 | tmp = htonl(eof); | 3406 | tmp = htonl(eof); |
3407 | write_bytes_to_xdr_buf(xdr->buf, starting_len , &tmp, 4); | 3407 | write_bytes_to_xdr_buf(xdr->buf, starting_len , &tmp, 4); |
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index e9fa966fc37f..350041a40fe5 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -38,7 +38,7 @@ static int nfsd_acceptable(void *expv, struct dentry *dentry) | |||
38 | /* make sure parents give x permission to user */ | 38 | /* make sure parents give x permission to user */ |
39 | int err; | 39 | int err; |
40 | parent = dget_parent(tdentry); | 40 | parent = dget_parent(tdentry); |
41 | err = inode_permission(parent->d_inode, MAY_EXEC); | 41 | err = inode_permission(d_inode(parent), MAY_EXEC); |
42 | if (err < 0) { | 42 | if (err < 0) { |
43 | dput(parent); | 43 | dput(parent); |
44 | break; | 44 | break; |
@@ -340,7 +340,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, int access) | |||
340 | if (error) | 340 | if (error) |
341 | goto out; | 341 | goto out; |
342 | 342 | ||
343 | error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); | 343 | error = nfsd_mode_check(rqstp, d_inode(dentry)->i_mode, type); |
344 | if (error) | 344 | if (error) |
345 | goto out; | 345 | goto out; |
346 | 346 | ||
@@ -412,8 +412,8 @@ static inline void _fh_update_old(struct dentry *dentry, | |||
412 | struct svc_export *exp, | 412 | struct svc_export *exp, |
413 | struct knfsd_fh *fh) | 413 | struct knfsd_fh *fh) |
414 | { | 414 | { |
415 | fh->ofh_ino = ino_t_to_u32(dentry->d_inode->i_ino); | 415 | fh->ofh_ino = ino_t_to_u32(d_inode(dentry)->i_ino); |
416 | fh->ofh_generation = dentry->d_inode->i_generation; | 416 | fh->ofh_generation = d_inode(dentry)->i_generation; |
417 | if (d_is_dir(dentry) || | 417 | if (d_is_dir(dentry) || |
418 | (exp->ex_flags & NFSEXP_NOSUBTREECHECK)) | 418 | (exp->ex_flags & NFSEXP_NOSUBTREECHECK)) |
419 | fh->ofh_dirino = 0; | 419 | fh->ofh_dirino = 0; |
@@ -426,7 +426,7 @@ static bool is_root_export(struct svc_export *exp) | |||
426 | 426 | ||
427 | static struct super_block *exp_sb(struct svc_export *exp) | 427 | static struct super_block *exp_sb(struct svc_export *exp) |
428 | { | 428 | { |
429 | return exp->ex_path.dentry->d_inode->i_sb; | 429 | return d_inode(exp->ex_path.dentry)->i_sb; |
430 | } | 430 | } |
431 | 431 | ||
432 | static bool fsid_type_ok_for_exp(u8 fsid_type, struct svc_export *exp) | 432 | static bool fsid_type_ok_for_exp(u8 fsid_type, struct svc_export *exp) |
@@ -520,12 +520,12 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, | |||
520 | * | 520 | * |
521 | */ | 521 | */ |
522 | 522 | ||
523 | struct inode * inode = dentry->d_inode; | 523 | struct inode * inode = d_inode(dentry); |
524 | dev_t ex_dev = exp_sb(exp)->s_dev; | 524 | dev_t ex_dev = exp_sb(exp)->s_dev; |
525 | 525 | ||
526 | dprintk("nfsd: fh_compose(exp %02x:%02x/%ld %pd2, ino=%ld)\n", | 526 | dprintk("nfsd: fh_compose(exp %02x:%02x/%ld %pd2, ino=%ld)\n", |
527 | MAJOR(ex_dev), MINOR(ex_dev), | 527 | MAJOR(ex_dev), MINOR(ex_dev), |
528 | (long) exp->ex_path.dentry->d_inode->i_ino, | 528 | (long) d_inode(exp->ex_path.dentry)->i_ino, |
529 | dentry, | 529 | dentry, |
530 | (inode ? inode->i_ino : 0)); | 530 | (inode ? inode->i_ino : 0)); |
531 | 531 | ||
@@ -558,7 +558,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, | |||
558 | fhp->fh_handle.ofh_dev = old_encode_dev(ex_dev); | 558 | fhp->fh_handle.ofh_dev = old_encode_dev(ex_dev); |
559 | fhp->fh_handle.ofh_xdev = fhp->fh_handle.ofh_dev; | 559 | fhp->fh_handle.ofh_xdev = fhp->fh_handle.ofh_dev; |
560 | fhp->fh_handle.ofh_xino = | 560 | fhp->fh_handle.ofh_xino = |
561 | ino_t_to_u32(exp->ex_path.dentry->d_inode->i_ino); | 561 | ino_t_to_u32(d_inode(exp->ex_path.dentry)->i_ino); |
562 | fhp->fh_handle.ofh_dirino = ino_t_to_u32(parent_ino(dentry)); | 562 | fhp->fh_handle.ofh_dirino = ino_t_to_u32(parent_ino(dentry)); |
563 | if (inode) | 563 | if (inode) |
564 | _fh_update_old(dentry, exp, &fhp->fh_handle); | 564 | _fh_update_old(dentry, exp, &fhp->fh_handle); |
@@ -570,7 +570,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, | |||
570 | mk_fsid(fhp->fh_handle.fh_fsid_type, | 570 | mk_fsid(fhp->fh_handle.fh_fsid_type, |
571 | fhp->fh_handle.fh_fsid, | 571 | fhp->fh_handle.fh_fsid, |
572 | ex_dev, | 572 | ex_dev, |
573 | exp->ex_path.dentry->d_inode->i_ino, | 573 | d_inode(exp->ex_path.dentry)->i_ino, |
574 | exp->ex_fsid, exp->ex_uuid); | 574 | exp->ex_fsid, exp->ex_uuid); |
575 | 575 | ||
576 | if (inode) | 576 | if (inode) |
@@ -597,7 +597,7 @@ fh_update(struct svc_fh *fhp) | |||
597 | goto out_bad; | 597 | goto out_bad; |
598 | 598 | ||
599 | dentry = fhp->fh_dentry; | 599 | dentry = fhp->fh_dentry; |
600 | if (!dentry->d_inode) | 600 | if (d_really_is_negative(dentry)) |
601 | goto out_negative; | 601 | goto out_negative; |
602 | if (fhp->fh_handle.fh_version != 1) { | 602 | if (fhp->fh_handle.fh_version != 1) { |
603 | _fh_update_old(dentry, fhp->fh_export, &fhp->fh_handle); | 603 | _fh_update_old(dentry, fhp->fh_export, &fhp->fh_handle); |
diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h index f22920442172..1e90dad4926b 100644 --- a/fs/nfsd/nfsfh.h +++ b/fs/nfsd/nfsfh.h | |||
@@ -225,7 +225,7 @@ fill_pre_wcc(struct svc_fh *fhp) | |||
225 | { | 225 | { |
226 | struct inode *inode; | 226 | struct inode *inode; |
227 | 227 | ||
228 | inode = fhp->fh_dentry->d_inode; | 228 | inode = d_inode(fhp->fh_dentry); |
229 | if (!fhp->fh_pre_saved) { | 229 | if (!fhp->fh_pre_saved) { |
230 | fhp->fh_pre_mtime = inode->i_mtime; | 230 | fhp->fh_pre_mtime = inode->i_mtime; |
231 | fhp->fh_pre_ctime = inode->i_ctime; | 231 | fhp->fh_pre_ctime = inode->i_ctime; |
@@ -264,7 +264,7 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass) | |||
264 | return; | 264 | return; |
265 | } | 265 | } |
266 | 266 | ||
267 | inode = dentry->d_inode; | 267 | inode = d_inode(dentry); |
268 | mutex_lock_nested(&inode->i_mutex, subclass); | 268 | mutex_lock_nested(&inode->i_mutex, subclass); |
269 | fill_pre_wcc(fhp); | 269 | fill_pre_wcc(fhp); |
270 | fhp->fh_locked = 1; | 270 | fhp->fh_locked = 1; |
@@ -284,7 +284,7 @@ fh_unlock(struct svc_fh *fhp) | |||
284 | { | 284 | { |
285 | if (fhp->fh_locked) { | 285 | if (fhp->fh_locked) { |
286 | fill_post_wcc(fhp); | 286 | fill_post_wcc(fhp); |
287 | mutex_unlock(&fhp->fh_dentry->d_inode->i_mutex); | 287 | mutex_unlock(&d_inode(fhp->fh_dentry)->i_mutex); |
288 | fhp->fh_locked = 0; | 288 | fhp->fh_locked = 0; |
289 | } | 289 | } |
290 | } | 290 | } |
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c index b8680738f588..aecbcd34d336 100644 --- a/fs/nfsd/nfsproc.c +++ b/fs/nfsd/nfsproc.c | |||
@@ -223,7 +223,7 @@ nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp, | |||
223 | } | 223 | } |
224 | fh_init(newfhp, NFS_FHSIZE); | 224 | fh_init(newfhp, NFS_FHSIZE); |
225 | nfserr = fh_compose(newfhp, dirfhp->fh_export, dchild, dirfhp); | 225 | nfserr = fh_compose(newfhp, dirfhp->fh_export, dchild, dirfhp); |
226 | if (!nfserr && !dchild->d_inode) | 226 | if (!nfserr && d_really_is_negative(dchild)) |
227 | nfserr = nfserr_noent; | 227 | nfserr = nfserr_noent; |
228 | dput(dchild); | 228 | dput(dchild); |
229 | if (nfserr) { | 229 | if (nfserr) { |
@@ -241,7 +241,7 @@ nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp, | |||
241 | } | 241 | } |
242 | } | 242 | } |
243 | 243 | ||
244 | inode = newfhp->fh_dentry->d_inode; | 244 | inode = d_inode(newfhp->fh_dentry); |
245 | 245 | ||
246 | /* Unfudge the mode bits */ | 246 | /* Unfudge the mode bits */ |
247 | if (attr->ia_valid & ATTR_MODE) { | 247 | if (attr->ia_valid & ATTR_MODE) { |
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c index 412d7061f9e5..79d964aa8079 100644 --- a/fs/nfsd/nfsxdr.c +++ b/fs/nfsd/nfsxdr.c | |||
@@ -187,7 +187,7 @@ encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | |||
187 | *p++ = htonl((u32) stat->ino); | 187 | *p++ = htonl((u32) stat->ino); |
188 | *p++ = htonl((u32) stat->atime.tv_sec); | 188 | *p++ = htonl((u32) stat->atime.tv_sec); |
189 | *p++ = htonl(stat->atime.tv_nsec ? stat->atime.tv_nsec / 1000 : 0); | 189 | *p++ = htonl(stat->atime.tv_nsec ? stat->atime.tv_nsec / 1000 : 0); |
190 | lease_get_mtime(dentry->d_inode, &time); | 190 | lease_get_mtime(d_inode(dentry), &time); |
191 | *p++ = htonl((u32) time.tv_sec); | 191 | *p++ = htonl((u32) time.tv_sec); |
192 | *p++ = htonl(time.tv_nsec ? time.tv_nsec / 1000 : 0); | 192 | *p++ = htonl(time.tv_nsec ? time.tv_nsec / 1000 : 0); |
193 | *p++ = htonl((u32) stat->ctime.tv_sec); | 193 | *p++ = htonl((u32) stat->ctime.tv_sec); |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 368526582429..84d770be056e 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -174,7 +174,7 @@ int nfsd_mountpoint(struct dentry *dentry, struct svc_export *exp) | |||
174 | return 1; | 174 | return 1; |
175 | if (!(exp->ex_flags & NFSEXP_V4ROOT)) | 175 | if (!(exp->ex_flags & NFSEXP_V4ROOT)) |
176 | return 0; | 176 | return 0; |
177 | return dentry->d_inode != NULL; | 177 | return d_inode(dentry) != NULL; |
178 | } | 178 | } |
179 | 179 | ||
180 | __be32 | 180 | __be32 |
@@ -270,7 +270,7 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name, | |||
270 | * dentry may be negative, it may need to be updated. | 270 | * dentry may be negative, it may need to be updated. |
271 | */ | 271 | */ |
272 | err = fh_compose(resfh, exp, dentry, fhp); | 272 | err = fh_compose(resfh, exp, dentry, fhp); |
273 | if (!err && !dentry->d_inode) | 273 | if (!err && d_really_is_negative(dentry)) |
274 | err = nfserr_noent; | 274 | err = nfserr_noent; |
275 | out: | 275 | out: |
276 | dput(dentry); | 276 | dput(dentry); |
@@ -284,7 +284,7 @@ out: | |||
284 | static int | 284 | static int |
285 | commit_metadata(struct svc_fh *fhp) | 285 | commit_metadata(struct svc_fh *fhp) |
286 | { | 286 | { |
287 | struct inode *inode = fhp->fh_dentry->d_inode; | 287 | struct inode *inode = d_inode(fhp->fh_dentry); |
288 | const struct export_operations *export_ops = inode->i_sb->s_export_op; | 288 | const struct export_operations *export_ops = inode->i_sb->s_export_op; |
289 | 289 | ||
290 | if (!EX_ISSYNC(fhp->fh_export)) | 290 | if (!EX_ISSYNC(fhp->fh_export)) |
@@ -364,7 +364,7 @@ static __be32 | |||
364 | nfsd_get_write_access(struct svc_rqst *rqstp, struct svc_fh *fhp, | 364 | nfsd_get_write_access(struct svc_rqst *rqstp, struct svc_fh *fhp, |
365 | struct iattr *iap) | 365 | struct iattr *iap) |
366 | { | 366 | { |
367 | struct inode *inode = fhp->fh_dentry->d_inode; | 367 | struct inode *inode = d_inode(fhp->fh_dentry); |
368 | int host_err; | 368 | int host_err; |
369 | 369 | ||
370 | if (iap->ia_size < inode->i_size) { | 370 | if (iap->ia_size < inode->i_size) { |
@@ -426,7 +426,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap, | |||
426 | } | 426 | } |
427 | 427 | ||
428 | dentry = fhp->fh_dentry; | 428 | dentry = fhp->fh_dentry; |
429 | inode = dentry->d_inode; | 429 | inode = d_inode(dentry); |
430 | 430 | ||
431 | /* Ignore any mode updates on symlinks */ | 431 | /* Ignore any mode updates on symlinks */ |
432 | if (S_ISLNK(inode->i_mode)) | 432 | if (S_ISLNK(inode->i_mode)) |
@@ -495,7 +495,7 @@ out: | |||
495 | */ | 495 | */ |
496 | int nfsd4_is_junction(struct dentry *dentry) | 496 | int nfsd4_is_junction(struct dentry *dentry) |
497 | { | 497 | { |
498 | struct inode *inode = dentry->d_inode; | 498 | struct inode *inode = d_inode(dentry); |
499 | 499 | ||
500 | if (inode == NULL) | 500 | if (inode == NULL) |
501 | return 0; | 501 | return 0; |
@@ -521,9 +521,9 @@ __be32 nfsd4_set_nfs4_label(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
521 | 521 | ||
522 | dentry = fhp->fh_dentry; | 522 | dentry = fhp->fh_dentry; |
523 | 523 | ||
524 | mutex_lock(&dentry->d_inode->i_mutex); | 524 | mutex_lock(&d_inode(dentry)->i_mutex); |
525 | host_error = security_inode_setsecctx(dentry, label->data, label->len); | 525 | host_error = security_inode_setsecctx(dentry, label->data, label->len); |
526 | mutex_unlock(&dentry->d_inode->i_mutex); | 526 | mutex_unlock(&d_inode(dentry)->i_mutex); |
527 | return nfserrno(host_error); | 527 | return nfserrno(host_error); |
528 | } | 528 | } |
529 | #else | 529 | #else |
@@ -706,7 +706,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, | |||
706 | 706 | ||
707 | path.mnt = fhp->fh_export->ex_path.mnt; | 707 | path.mnt = fhp->fh_export->ex_path.mnt; |
708 | path.dentry = fhp->fh_dentry; | 708 | path.dentry = fhp->fh_dentry; |
709 | inode = path.dentry->d_inode; | 709 | inode = d_inode(path.dentry); |
710 | 710 | ||
711 | /* Disallow write access to files with the append-only bit set | 711 | /* Disallow write access to files with the append-only bit set |
712 | * or any access when mandatory locking enabled | 712 | * or any access when mandatory locking enabled |
@@ -1211,7 +1211,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1211 | goto out; | 1211 | goto out; |
1212 | 1212 | ||
1213 | dentry = fhp->fh_dentry; | 1213 | dentry = fhp->fh_dentry; |
1214 | dirp = dentry->d_inode; | 1214 | dirp = d_inode(dentry); |
1215 | 1215 | ||
1216 | err = nfserr_notdir; | 1216 | err = nfserr_notdir; |
1217 | if (!dirp->i_op->lookup) | 1217 | if (!dirp->i_op->lookup) |
@@ -1250,7 +1250,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1250 | * Make sure the child dentry is still negative ... | 1250 | * Make sure the child dentry is still negative ... |
1251 | */ | 1251 | */ |
1252 | err = nfserr_exist; | 1252 | err = nfserr_exist; |
1253 | if (dchild->d_inode) { | 1253 | if (d_really_is_positive(dchild)) { |
1254 | dprintk("nfsd_create: dentry %pd/%pd not negative!\n", | 1254 | dprintk("nfsd_create: dentry %pd/%pd not negative!\n", |
1255 | dentry, dchild); | 1255 | dentry, dchild); |
1256 | goto out; | 1256 | goto out; |
@@ -1353,7 +1353,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1353 | goto out; | 1353 | goto out; |
1354 | 1354 | ||
1355 | dentry = fhp->fh_dentry; | 1355 | dentry = fhp->fh_dentry; |
1356 | dirp = dentry->d_inode; | 1356 | dirp = d_inode(dentry); |
1357 | 1357 | ||
1358 | /* Get all the sanity checks out of the way before | 1358 | /* Get all the sanity checks out of the way before |
1359 | * we lock the parent. */ | 1359 | * we lock the parent. */ |
@@ -1376,7 +1376,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1376 | goto out_nfserr; | 1376 | goto out_nfserr; |
1377 | 1377 | ||
1378 | /* If file doesn't exist, check for permissions to create one */ | 1378 | /* If file doesn't exist, check for permissions to create one */ |
1379 | if (!dchild->d_inode) { | 1379 | if (d_really_is_negative(dchild)) { |
1380 | err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_CREATE); | 1380 | err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_CREATE); |
1381 | if (err) | 1381 | if (err) |
1382 | goto out; | 1382 | goto out; |
@@ -1397,7 +1397,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1397 | v_atime = verifier[1]&0x7fffffff; | 1397 | v_atime = verifier[1]&0x7fffffff; |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | if (dchild->d_inode) { | 1400 | if (d_really_is_positive(dchild)) { |
1401 | err = 0; | 1401 | err = 0; |
1402 | 1402 | ||
1403 | switch (createmode) { | 1403 | switch (createmode) { |
@@ -1420,17 +1420,17 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1420 | } | 1420 | } |
1421 | break; | 1421 | break; |
1422 | case NFS3_CREATE_EXCLUSIVE: | 1422 | case NFS3_CREATE_EXCLUSIVE: |
1423 | if ( dchild->d_inode->i_mtime.tv_sec == v_mtime | 1423 | if ( d_inode(dchild)->i_mtime.tv_sec == v_mtime |
1424 | && dchild->d_inode->i_atime.tv_sec == v_atime | 1424 | && d_inode(dchild)->i_atime.tv_sec == v_atime |
1425 | && dchild->d_inode->i_size == 0 ) { | 1425 | && d_inode(dchild)->i_size == 0 ) { |
1426 | if (created) | 1426 | if (created) |
1427 | *created = 1; | 1427 | *created = 1; |
1428 | break; | 1428 | break; |
1429 | } | 1429 | } |
1430 | case NFS4_CREATE_EXCLUSIVE4_1: | 1430 | case NFS4_CREATE_EXCLUSIVE4_1: |
1431 | if ( dchild->d_inode->i_mtime.tv_sec == v_mtime | 1431 | if ( d_inode(dchild)->i_mtime.tv_sec == v_mtime |
1432 | && dchild->d_inode->i_atime.tv_sec == v_atime | 1432 | && d_inode(dchild)->i_atime.tv_sec == v_atime |
1433 | && dchild->d_inode->i_size == 0 ) { | 1433 | && d_inode(dchild)->i_size == 0 ) { |
1434 | if (created) | 1434 | if (created) |
1435 | *created = 1; | 1435 | *created = 1; |
1436 | goto set_attr; | 1436 | goto set_attr; |
@@ -1513,7 +1513,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) | |||
1513 | 1513 | ||
1514 | path.mnt = fhp->fh_export->ex_path.mnt; | 1514 | path.mnt = fhp->fh_export->ex_path.mnt; |
1515 | path.dentry = fhp->fh_dentry; | 1515 | path.dentry = fhp->fh_dentry; |
1516 | inode = path.dentry->d_inode; | 1516 | inode = d_inode(path.dentry); |
1517 | 1517 | ||
1518 | err = nfserr_inval; | 1518 | err = nfserr_inval; |
1519 | if (!inode->i_op->readlink) | 1519 | if (!inode->i_op->readlink) |
@@ -1576,7 +1576,7 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1576 | if (IS_ERR(dnew)) | 1576 | if (IS_ERR(dnew)) |
1577 | goto out_nfserr; | 1577 | goto out_nfserr; |
1578 | 1578 | ||
1579 | host_err = vfs_symlink(dentry->d_inode, dnew, path); | 1579 | host_err = vfs_symlink(d_inode(dentry), dnew, path); |
1580 | err = nfserrno(host_err); | 1580 | err = nfserrno(host_err); |
1581 | if (!err) | 1581 | if (!err) |
1582 | err = nfserrno(commit_metadata(fhp)); | 1582 | err = nfserrno(commit_metadata(fhp)); |
@@ -1632,7 +1632,7 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp, | |||
1632 | 1632 | ||
1633 | fh_lock_nested(ffhp, I_MUTEX_PARENT); | 1633 | fh_lock_nested(ffhp, I_MUTEX_PARENT); |
1634 | ddir = ffhp->fh_dentry; | 1634 | ddir = ffhp->fh_dentry; |
1635 | dirp = ddir->d_inode; | 1635 | dirp = d_inode(ddir); |
1636 | 1636 | ||
1637 | dnew = lookup_one_len(name, ddir, len); | 1637 | dnew = lookup_one_len(name, ddir, len); |
1638 | host_err = PTR_ERR(dnew); | 1638 | host_err = PTR_ERR(dnew); |
@@ -1642,7 +1642,7 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp, | |||
1642 | dold = tfhp->fh_dentry; | 1642 | dold = tfhp->fh_dentry; |
1643 | 1643 | ||
1644 | err = nfserr_noent; | 1644 | err = nfserr_noent; |
1645 | if (!dold->d_inode) | 1645 | if (d_really_is_negative(dold)) |
1646 | goto out_dput; | 1646 | goto out_dput; |
1647 | host_err = vfs_link(dold, dirp, dnew, NULL); | 1647 | host_err = vfs_link(dold, dirp, dnew, NULL); |
1648 | if (!host_err) { | 1648 | if (!host_err) { |
@@ -1689,10 +1689,10 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen, | |||
1689 | goto out; | 1689 | goto out; |
1690 | 1690 | ||
1691 | fdentry = ffhp->fh_dentry; | 1691 | fdentry = ffhp->fh_dentry; |
1692 | fdir = fdentry->d_inode; | 1692 | fdir = d_inode(fdentry); |
1693 | 1693 | ||
1694 | tdentry = tfhp->fh_dentry; | 1694 | tdentry = tfhp->fh_dentry; |
1695 | tdir = tdentry->d_inode; | 1695 | tdir = d_inode(tdentry); |
1696 | 1696 | ||
1697 | err = nfserr_perm; | 1697 | err = nfserr_perm; |
1698 | if (!flen || isdotent(fname, flen) || !tlen || isdotent(tname, tlen)) | 1698 | if (!flen || isdotent(fname, flen) || !tlen || isdotent(tname, tlen)) |
@@ -1717,7 +1717,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen, | |||
1717 | goto out_nfserr; | 1717 | goto out_nfserr; |
1718 | 1718 | ||
1719 | host_err = -ENOENT; | 1719 | host_err = -ENOENT; |
1720 | if (!odentry->d_inode) | 1720 | if (d_really_is_negative(odentry)) |
1721 | goto out_dput_old; | 1721 | goto out_dput_old; |
1722 | host_err = -EINVAL; | 1722 | host_err = -EINVAL; |
1723 | if (odentry == trap) | 1723 | if (odentry == trap) |
@@ -1790,21 +1790,21 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
1790 | 1790 | ||
1791 | fh_lock_nested(fhp, I_MUTEX_PARENT); | 1791 | fh_lock_nested(fhp, I_MUTEX_PARENT); |
1792 | dentry = fhp->fh_dentry; | 1792 | dentry = fhp->fh_dentry; |
1793 | dirp = dentry->d_inode; | 1793 | dirp = d_inode(dentry); |
1794 | 1794 | ||
1795 | rdentry = lookup_one_len(fname, dentry, flen); | 1795 | rdentry = lookup_one_len(fname, dentry, flen); |
1796 | host_err = PTR_ERR(rdentry); | 1796 | host_err = PTR_ERR(rdentry); |
1797 | if (IS_ERR(rdentry)) | 1797 | if (IS_ERR(rdentry)) |
1798 | goto out_nfserr; | 1798 | goto out_nfserr; |
1799 | 1799 | ||
1800 | if (!rdentry->d_inode) { | 1800 | if (d_really_is_negative(rdentry)) { |
1801 | dput(rdentry); | 1801 | dput(rdentry); |
1802 | err = nfserr_noent; | 1802 | err = nfserr_noent; |
1803 | goto out; | 1803 | goto out; |
1804 | } | 1804 | } |
1805 | 1805 | ||
1806 | if (!type) | 1806 | if (!type) |
1807 | type = rdentry->d_inode->i_mode & S_IFMT; | 1807 | type = d_inode(rdentry)->i_mode & S_IFMT; |
1808 | 1808 | ||
1809 | if (type != S_IFDIR) | 1809 | if (type != S_IFDIR) |
1810 | host_err = vfs_unlink(dirp, rdentry, NULL); | 1810 | host_err = vfs_unlink(dirp, rdentry, NULL); |
@@ -2015,7 +2015,7 @@ __be32 | |||
2015 | nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp, | 2015 | nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp, |
2016 | struct dentry *dentry, int acc) | 2016 | struct dentry *dentry, int acc) |
2017 | { | 2017 | { |
2018 | struct inode *inode = dentry->d_inode; | 2018 | struct inode *inode = d_inode(dentry); |
2019 | int err; | 2019 | int err; |
2020 | 2020 | ||
2021 | if ((acc & NFSD_MAY_MASK) == NFSD_MAY_NOP) | 2021 | if ((acc & NFSD_MAY_MASK) == NFSD_MAY_NOP) |
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 556ce2e47555..f982ae84f0cd 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h | |||
@@ -631,7 +631,7 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) | |||
631 | { | 631 | { |
632 | BUG_ON(!fhp->fh_pre_saved); | 632 | BUG_ON(!fhp->fh_pre_saved); |
633 | cinfo->atomic = fhp->fh_post_saved; | 633 | cinfo->atomic = fhp->fh_post_saved; |
634 | cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode); | 634 | cinfo->change_supported = IS_I_VERSION(d_inode(fhp->fh_dentry)); |
635 | 635 | ||
636 | cinfo->before_change = fhp->fh_pre_change; | 636 | cinfo->before_change = fhp->fh_pre_change; |
637 | cinfo->after_change = fhp->fh_post_change; | 637 | cinfo->after_change = fhp->fh_post_change; |