1
Index: linux-2.6/fs/nfsd/nfs2acl.c
2
===================================================================
3
--- linux-2.6.orig/fs/nfsd/nfs2acl.c
4
+++ linux-2.6/fs/nfsd/nfs2acl.c
5
@@ -62,7 +62,7 @@ static __be32 nfsacld_proc_getacl(struct
7
/* Solaris returns the inode's minimum ACL. */
9
- struct inode *inode = fh->fh_dentry->d_inode;
10
+ struct inode *inode = fh->fh_path.dentry->d_inode;
11
acl = posix_acl_from_mode(inode->i_mode, GFP_KERNEL);
13
resp->acl_access = acl;
14
@@ -220,7 +220,7 @@ static int nfsaclsvc_decode_accessargs(s
15
static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
16
struct nfsd3_getaclres *resp)
18
- struct dentry *dentry = resp->fh.fh_dentry;
19
+ struct dentry *dentry = resp->fh.fh_path.dentry;
20
struct inode *inode = dentry->d_inode;
21
struct kvec *head = rqstp->rq_res.head;
23
Index: linux-2.6/fs/nfsd/nfs3acl.c
24
===================================================================
25
--- linux-2.6.orig/fs/nfsd/nfs3acl.c
26
+++ linux-2.6/fs/nfsd/nfs3acl.c
27
@@ -58,7 +58,7 @@ static __be32 nfsd3_proc_getacl(struct s
29
/* Solaris returns the inode's minimum ACL. */
31
- struct inode *inode = fh->fh_dentry->d_inode;
32
+ struct inode *inode = fh->fh_path.dentry->d_inode;
33
acl = posix_acl_from_mode(inode->i_mode, GFP_KERNEL);
35
resp->acl_access = acl;
36
@@ -166,7 +166,7 @@ static int nfs3svc_decode_setaclargs(str
37
static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
38
struct nfsd3_getaclres *resp)
40
- struct dentry *dentry = resp->fh.fh_dentry;
41
+ struct dentry *dentry = resp->fh.fh_path.dentry;
43
p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh);
44
if (resp->status == 0 && dentry && dentry->d_inode) {
45
Index: linux-2.6/fs/nfsd/nfs3proc.c
46
===================================================================
47
--- linux-2.6.orig/fs/nfsd/nfs3proc.c
48
+++ linux-2.6/fs/nfsd/nfs3proc.c
49
@@ -58,7 +58,6 @@ nfsd3_proc_getattr(struct svc_rqst *rqst
55
dprintk("nfsd: GETATTR(3) %s\n",
56
SVCFH_fmt(&argp->fh));
57
@@ -68,9 +67,7 @@ nfsd3_proc_getattr(struct svc_rqst *rqst
59
RETURN_STATUS(nfserr);
61
- path.mnt = resp->fh.fh_export->ex_mnt;
62
- path.dentry = resp->fh.fh_dentry;
63
- err = vfs_getattr(&path, &resp->stat);
64
+ err = vfs_getattr(&resp->fh.fh_path, &resp->stat);
65
nfserr = nfserrno(err);
67
RETURN_STATUS(nfserr);
68
@@ -187,7 +184,7 @@ nfsd3_proc_read(struct svc_rqst *rqstp,
69
rqstp->rq_vec, argp->vlen,
72
- struct inode *inode = resp->fh.fh_dentry->d_inode;
73
+ struct inode *inode = resp->fh.fh_path.dentry->d_inode;
75
resp->eof = (argp->offset + resp->count) >= inode->i_size;
77
@@ -566,7 +563,7 @@ nfsd3_proc_fsinfo(struct svc_rqst * rqst
78
* different read/write sizes for file systems known to have
79
* problems with large blocks */
81
- struct super_block *sb = argp->fh.fh_dentry->d_inode->i_sb;
82
+ struct super_block *sb = argp->fh.fh_path.dentry->d_inode->i_sb;
84
/* Note that we don't care for remote fs's here */
85
if (sb->s_magic == 0x4d44 /* MSDOS_SUPER_MAGIC */) {
86
@@ -602,7 +599,7 @@ nfsd3_proc_pathconf(struct svc_rqst * rq
87
nfserr = fh_verify(rqstp, &argp->fh, 0, MAY_NOP);
90
- struct super_block *sb = argp->fh.fh_dentry->d_inode->i_sb;
91
+ struct super_block *sb = argp->fh.fh_path.dentry->d_inode->i_sb;
93
/* Note that we don't care for remote fs's here */
94
switch (sb->s_magic) {
95
Index: linux-2.6/fs/nfsd/nfs3xdr.c
96
===================================================================
97
--- linux-2.6.orig/fs/nfsd/nfs3xdr.c
98
+++ linux-2.6/fs/nfsd/nfs3xdr.c
99
@@ -153,7 +153,7 @@ static __be32 *
100
encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp,
103
- struct dentry *dentry = fhp->fh_dentry;
104
+ struct dentry *dentry = fhp->fh_path.dentry;
105
struct timespec time;
107
*p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]);
108
@@ -185,7 +185,7 @@ encode_fattr3(struct svc_rqst *rqstp, __
110
encode_saved_post_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
112
- struct inode *inode = fhp->fh_dentry->d_inode;
113
+ struct inode *inode = fhp->fh_path.dentry->d_inode;
115
/* Attributes to follow */
117
@@ -223,15 +223,13 @@ encode_saved_post_attr(struct svc_rqst *
119
encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
122
+ struct dentry *dentry = fhp->fh_path.dentry;
124
- path.dentry = fhp->fh_dentry;
125
- if (path.dentry && path.dentry->d_inode != NULL) {
126
+ if (dentry && dentry->d_inode != NULL) {
130
- path.mnt = fhp->fh_export->ex_mnt;
131
- err = vfs_getattr(&path, &stat);
132
+ err = vfs_getattr(&fhp->fh_path, &stat);
134
*p++ = xdr_one; /* attributes follow */
135
return encode_fattr3(rqstp, p, fhp, &stat);
136
@@ -254,7 +252,7 @@ nfs3svc_encode_post_op_attr(struct svc_r
138
encode_wcc_data(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
140
- struct dentry *dentry = fhp->fh_dentry;
141
+ struct dentry *dentry = fhp->fh_path.dentry;
143
if (dentry && dentry->d_inode && fhp->fh_post_saved) {
144
if (fhp->fh_pre_saved) {
145
@@ -808,7 +806,7 @@ compose_entry_fh(struct nfsd3_readdirres
146
struct dentry *dparent, *dchild;
149
- dparent = cd->fh.fh_dentry;
150
+ dparent = cd->fh.fh_path.dentry;
151
exp = cd->fh.fh_export;
153
fh_init(fhp, NFS3_FHSIZE);
154
Index: linux-2.6/fs/nfsd/nfs4proc.c
155
===================================================================
156
--- linux-2.6.orig/fs/nfsd/nfs4proc.c
157
+++ linux-2.6/fs/nfsd/nfs4proc.c
158
@@ -54,7 +54,7 @@ static inline void
159
fh_dup2(struct svc_fh *dst, struct svc_fh *src)
162
- dget(src->fh_dentry);
163
+ dget(src->fh_path.dentry);
165
cache_get(&src->fh_export->h);
167
@@ -261,7 +261,7 @@ static __be32
168
nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
169
struct svc_fh **getfh)
171
- if (!cstate->current_fh.fh_dentry)
172
+ if (!cstate->current_fh.fh_path.dentry)
173
return nfserr_nofilehandle;
175
*getfh = &cstate->current_fh;
176
@@ -295,7 +295,7 @@ static __be32
177
nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
180
- if (!cstate->save_fh.fh_dentry)
181
+ if (!cstate->save_fh.fh_path.dentry)
182
return nfserr_restorefh;
184
fh_dup2(&cstate->current_fh, &cstate->save_fh);
185
@@ -306,7 +306,7 @@ static __be32
186
nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
189
- if (!cstate->current_fh.fh_dentry)
190
+ if (!cstate->current_fh.fh_path.dentry)
191
return nfserr_nofilehandle;
193
fh_dup2(&cstate->save_fh, &cstate->current_fh);
194
@@ -457,7 +457,7 @@ nfsd4_link(struct svc_rqst *rqstp, struc
196
__be32 status = nfserr_nofilehandle;
198
- if (!cstate->save_fh.fh_dentry)
199
+ if (!cstate->save_fh.fh_path.dentry)
201
status = nfsd_link(rqstp, &cstate->current_fh,
202
link->li_name, link->li_namelen, &cstate->save_fh);
203
@@ -477,7 +477,7 @@ nfsd4_lookupp(struct svc_rqst *rqstp, st
204
if((ret = exp_pseudoroot(rqstp->rq_client, &tmp_fh,
205
&rqstp->rq_chandle)) != 0)
207
- if (tmp_fh.fh_dentry == cstate->current_fh.fh_dentry) {
208
+ if (tmp_fh.fh_path.dentry == cstate->current_fh.fh_path.dentry) {
212
@@ -583,7 +583,7 @@ nfsd4_rename(struct svc_rqst *rqstp, str
214
__be32 status = nfserr_nofilehandle;
216
- if (!cstate->save_fh.fh_dentry)
217
+ if (!cstate->save_fh.fh_path.dentry)
219
if (nfs4_in_grace() && !(cstate->save_fh.fh_export->ex_flags
220
& NFSEXP_NOSUBTREECHECK))
221
@@ -597,8 +597,8 @@ nfsd4_rename(struct svc_rqst *rqstp, str
222
if (status == nfserr_isdir)
223
status = nfserr_exist;
224
else if ((status == nfserr_notdir) &&
225
- (S_ISDIR(cstate->save_fh.fh_dentry->d_inode->i_mode) &&
226
- S_ISDIR(cstate->current_fh.fh_dentry->d_inode->i_mode)))
227
+ (S_ISDIR(cstate->save_fh.fh_path.dentry->d_inode->i_mode) &&
228
+ S_ISDIR(cstate->current_fh.fh_path.dentry->d_inode->i_mode)))
229
status = nfserr_exist;
230
else if (status == nfserr_symlink)
231
status = nfserr_notdir;
232
@@ -716,7 +716,7 @@ _nfsd4_verify(struct svc_rqst *rqstp, st
234
status = nfsd4_encode_fattr(&cstate->current_fh,
235
cstate->current_fh.fh_export,
236
- cstate->current_fh.fh_dentry, buf,
237
+ &cstate->current_fh.fh_path, buf,
238
&count, verify->ve_bmval,
241
@@ -876,7 +876,7 @@ nfsd4_proc_compound(struct svc_rqst *rqs
243
opdesc = &nfsd4_ops[op->opnum];
245
- if (!cstate->current_fh.fh_dentry) {
246
+ if (!cstate->current_fh.fh_path.dentry) {
247
if (!(opdesc->op_flags & ALLOWED_WITHOUT_FH)) {
248
op->status = nfserr_nofilehandle;
250
Index: linux-2.6/fs/nfsd/nfs4state.c
251
===================================================================
252
--- linux-2.6.orig/fs/nfsd/nfs4state.c
253
+++ linux-2.6/fs/nfsd/nfs4state.c
254
@@ -1286,7 +1286,7 @@ test_share(struct nfs4_stateid *stp, str
256
nfs4_share_conflict(struct svc_fh *current_fh, unsigned int deny_type)
258
- struct inode *ino = current_fh->fh_dentry->d_inode;
259
+ struct inode *ino = current_fh->fh_path.dentry->d_inode;
260
struct nfs4_file *fp;
261
struct nfs4_stateid *stp;
263
@@ -1745,7 +1745,7 @@ __be32
264
nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
266
struct nfs4_file *fp = NULL;
267
- struct inode *ino = current_fh->fh_dentry->d_inode;
268
+ struct inode *ino = current_fh->fh_path.dentry->d_inode;
269
struct nfs4_stateid *stp = NULL;
270
struct nfs4_delegation *dp = NULL;
272
@@ -1969,7 +1969,7 @@ search_close_lru(u32 st_id, int flags)
274
nfs4_check_fh(struct svc_fh *fhp, struct nfs4_stateid *stp)
276
- return fhp->fh_dentry->d_inode != stp->st_vfs_file->f_path.dentry->d_inode;
277
+ return fhp->fh_path.dentry->d_inode != stp->st_vfs_file->f_path.dentry->d_inode;
281
@@ -2052,7 +2052,7 @@ nfs4_preprocess_stateid_op(struct svc_fh
282
struct nfs4_stateid *stp = NULL;
283
struct nfs4_delegation *dp = NULL;
285
- struct inode *ino = current_fh->fh_dentry->d_inode;
286
+ struct inode *ino = current_fh->fh_path.dentry->d_inode;
289
dprintk("NFSD: preprocess_stateid_op: stateid = (%08x/%08x/%08x/%08x)\n",
290
@@ -2253,8 +2253,8 @@ nfsd4_open_confirm(struct svc_rqst *rqst
291
struct nfs4_stateid *stp;
293
dprintk("NFSD: nfsd4_open_confirm on file %.*s\n",
294
- (int)cstate->current_fh.fh_dentry->d_name.len,
295
- cstate->current_fh.fh_dentry->d_name.name);
296
+ (int)cstate->current_fh.fh_path.dentry->d_name.len,
297
+ cstate->current_fh.fh_path.dentry->d_name.name);
299
status = fh_verify(rqstp, &cstate->current_fh, S_IFREG, 0);
301
@@ -2324,8 +2324,8 @@ nfsd4_open_downgrade(struct svc_rqst *rq
302
unsigned int share_access;
304
dprintk("NFSD: nfsd4_open_downgrade on file %.*s\n",
305
- (int)cstate->current_fh.fh_dentry->d_name.len,
306
- cstate->current_fh.fh_dentry->d_name.name);
307
+ (int)cstate->current_fh.fh_path.dentry->d_name.len,
308
+ cstate->current_fh.fh_path.dentry->d_name.name);
310
if (!access_valid(od->od_share_access)
311
|| !deny_valid(od->od_share_deny))
312
@@ -2380,8 +2380,8 @@ nfsd4_close(struct svc_rqst *rqstp, stru
313
struct nfs4_stateid *stp;
315
dprintk("NFSD: nfsd4_close on file %.*s\n",
316
- (int)cstate->current_fh.fh_dentry->d_name.len,
317
- cstate->current_fh.fh_dentry->d_name.name);
318
+ (int)cstate->current_fh.fh_path.dentry->d_name.len,
319
+ cstate->current_fh.fh_path.dentry->d_name.name);
322
/* check close_lru for replay */
323
@@ -2837,7 +2837,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, stru
327
- inode = cstate->current_fh.fh_dentry->d_inode;
328
+ inode = cstate->current_fh.fh_path.dentry->d_inode;
329
locks_init_lock(&file_lock);
330
switch (lockt->lt_type) {
332
@@ -2876,7 +2876,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, stru
333
* only the dentry:inode set.
335
memset(&file, 0, sizeof (struct file));
336
- file.f_path.dentry = cstate->current_fh.fh_dentry;
337
+ file.f_path.dentry = cstate->current_fh.fh_path.dentry;
340
if (posix_test_lock(&file, &file_lock, &conflock)) {
341
Index: linux-2.6/fs/nfsd/nfs4xdr.c
342
===================================================================
343
--- linux-2.6.orig/fs/nfsd/nfs4xdr.c
344
+++ linux-2.6/fs/nfsd/nfs4xdr.c
345
@@ -1424,7 +1424,7 @@ static __be32 fattr_handle_absent_fs(u32
348
nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
349
- struct dentry *dentry, __be32 *buffer, int *countp, u32 *bmval,
350
+ struct path *path, __be32 *buffer, int *countp, u32 *bmval,
351
struct svc_rqst *rqstp)
353
u32 bmval0 = bmval[0];
354
@@ -1442,7 +1442,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
357
struct nfs4_acl *acl = NULL;
359
+ struct dentry *dentry = path->dentry;
361
BUG_ON(bmval1 & NFSD_WRITEONLY_ATTRS_WORD1);
362
BUG_ON(bmval0 & ~NFSD_SUPPORTED_ATTRS_WORD0);
363
@@ -1454,9 +1454,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
367
- path.mnt = exp->ex_mnt;
368
- path.dentry = dentry;
369
- err = vfs_getattr(&path, &stat);
370
+ err = vfs_getattr(path, &stat);
373
if ((bmval0 & (FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL)) ||
374
@@ -1839,28 +1837,29 @@ nfsd4_encode_dirent_fattr(struct nfsd4_r
375
const char *name, int namlen, __be32 *p, int *buflen)
377
struct svc_export *exp = cd->rd_fhp->fh_export;
378
- struct dentry *dentry;
382
- dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen);
383
- if (IS_ERR(dentry))
384
- return nfserrno(PTR_ERR(dentry));
385
+ path.dentry = lookup_one_len(name, cd->rd_fhp->fh_path.dentry, namlen);
386
+ if (IS_ERR(path.dentry))
387
+ return nfserrno(PTR_ERR(path.dentry));
390
- if (d_mountpoint(dentry)) {
391
+ if (d_mountpoint(path.dentry)) {
394
- err = nfsd_cross_mnt(cd->rd_rqstp, &dentry, &exp);
395
+ err = nfsd_cross_mnt(cd->rd_rqstp, &path.dentry, &exp);
397
nfserr = nfserrno(err);
402
- nfserr = nfsd4_encode_fattr(NULL, exp, dentry, p, buflen, cd->rd_bmval,
403
+ path.mnt = exp->ex_mnt;
404
+ nfserr = nfsd4_encode_fattr(NULL, exp, &path, p, buflen, cd->rd_bmval,
412
@@ -2010,7 +2009,7 @@ nfsd4_encode_getattr(struct nfsd4_compou
415
buflen = resp->end - resp->p - (COMPOUND_ERR_SLACK_SPACE >> 2);
416
- nfserr = nfsd4_encode_fattr(fhp, fhp->fh_export, fhp->fh_dentry,
417
+ nfserr = nfsd4_encode_fattr(fhp, fhp->fh_export, &fhp->fh_path,
418
resp->p, &buflen, getattr->ga_bmval,
421
@@ -2248,7 +2247,7 @@ nfsd4_encode_read(struct nfsd4_compoundr
424
eof = (read->rd_offset + maxcount >=
425
- read->rd_fhp->fh_dentry->d_inode->i_size);
426
+ read->rd_fhp->fh_path.dentry->d_inode->i_size);
430
Index: linux-2.6/fs/nfsd/nfsfh.c
431
===================================================================
432
--- linux-2.6.orig/fs/nfsd/nfsfh.c
433
+++ linux-2.6/fs/nfsd/nfsfh.c
434
@@ -123,7 +123,7 @@ fh_verify(struct svc_rqst *rqstp, struct
435
/* keep this filehandle for possible reference when encoding attributes */
436
rqstp->rq_reffh = fh;
438
- if (!fhp->fh_dentry) {
439
+ if (!fhp->fh_path.dentry) {
441
__u32 tfh[3]; /* filehandle fragment for oldstyle filehandles */
443
@@ -238,7 +238,7 @@ fh_verify(struct svc_rqst *rqstp, struct
447
- fhp->fh_dentry = dentry;
448
+ fhp->fh_path.dentry = dentry;
449
fhp->fh_export = exp;
452
@@ -246,7 +246,7 @@ fh_verify(struct svc_rqst *rqstp, struct
453
* (e.g. nfsproc_create calls fh_verify, then nfsd_create does as well)
455
dprintk("nfsd: fh_verify - just checking\n");
456
- dentry = fhp->fh_dentry;
457
+ dentry = fhp->fh_path.dentry;
458
exp = fhp->fh_export;
459
/* Set user creds for this exportpoint; necessary even
460
* in the "just checking" case because this may be a
461
@@ -372,7 +372,7 @@ fh_compose(struct svc_fh *fhp, struct sv
465
- if (fhp->fh_locked || fhp->fh_dentry) {
466
+ if (fhp->fh_locked || fhp->fh_path.dentry) {
467
printk(KERN_ERR "fh_compose: fh %s/%s not initialized!\n",
468
parent->d_name.name, dentry->d_name.name);
470
@@ -380,7 +380,8 @@ fh_compose(struct svc_fh *fhp, struct sv
471
printk(KERN_ERR "fh_compose: called with maxsize %d! %s/%s\n",
472
fhp->fh_maxsize, parent->d_name.name, dentry->d_name.name);
474
- fhp->fh_dentry = dget(dentry); /* our internal copy */
475
+ fhp->fh_path.mnt = exp->ex_mnt; /* FIXME: can this get released while we still keep the copy here? Probably not... */
476
+ fhp->fh_path.dentry = dget(dentry); /* our internal copy */
477
fhp->fh_export = exp;
480
@@ -459,10 +460,10 @@ fh_update(struct svc_fh *fhp)
481
struct dentry *dentry;
484
- if (!fhp->fh_dentry)
485
+ if (!fhp->fh_path.dentry)
488
- dentry = fhp->fh_dentry;
489
+ dentry = fhp->fh_path.dentry;
490
if (!dentry->d_inode)
492
if (fhp->fh_handle.fh_version != 1) {
493
@@ -498,11 +499,11 @@ out_negative:
495
fh_put(struct svc_fh *fhp)
497
- struct dentry * dentry = fhp->fh_dentry;
498
+ struct dentry * dentry = fhp->fh_path.dentry;
499
struct svc_export * exp = fhp->fh_export;
502
- fhp->fh_dentry = NULL;
503
+ fhp->fh_path.dentry = NULL;
505
#ifdef CONFIG_NFSD_V3
506
fhp->fh_pre_saved = 0;
507
Index: linux-2.6/fs/nfsd/nfsproc.c
508
===================================================================
509
--- linux-2.6.orig/fs/nfsd/nfsproc.c
510
+++ linux-2.6/fs/nfsd/nfsproc.c
511
@@ -39,25 +39,17 @@ nfsd_proc_null(struct svc_rqst *rqstp, v
513
nfsd_return_attrs(__be32 err, struct nfsd_attrstat *resp)
519
- path.mnt = resp->fh.fh_export->ex_mnt;
520
- path.dentry = resp->fh.fh_dentry;
521
- return nfserrno(vfs_getattr(&path, &resp->stat));
522
+ return nfserrno(vfs_getattr(&resp->fh.fh_path, &resp->stat));
526
nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp)
532
- path.mnt = resp->fh.fh_export->ex_mnt;
533
- path.dentry = resp->fh.fh_dentry;
534
- return nfserrno(vfs_getattr(&path, &resp->stat));
535
+ return nfserrno(vfs_getattr(&resp->fh.fh_path, &resp->stat));
538
* Get a file's attributes
539
@@ -143,7 +135,6 @@ static __be32
540
nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp,
541
struct nfsd_readres *resp)
546
dprintk("nfsd: READ %s %d bytes at %d\n",
547
@@ -172,9 +163,7 @@ nfsd_proc_read(struct svc_rqst *rqstp, s
551
- path.mnt = resp->fh.fh_export->ex_mnt;
552
- path.dentry = resp->fh.fh_dentry;
553
- return nfserrno(vfs_getattr(&path, &resp->stat));
554
+ return nfserrno(vfs_getattr(&resp->fh.fh_path, &resp->stat));
558
@@ -236,7 +225,7 @@ nfsd_proc_create(struct svc_rqst *rqstp,
559
if (isdotent(argp->name, argp->len))
561
fh_lock_nested(dirfhp, I_MUTEX_PARENT);
562
- dchild = lookup_one_len(argp->name, dirfhp->fh_dentry, argp->len);
563
+ dchild = lookup_one_len(argp->name, dirfhp->fh_path.dentry, argp->len);
564
if (IS_ERR(dchild)) {
565
nfserr = nfserrno(PTR_ERR(dchild));
567
@@ -254,14 +243,14 @@ nfsd_proc_create(struct svc_rqst *rqstp,
568
* whether the file exists or not. Time to bail ...
570
nfserr = nfserr_acces;
571
- if (!newfhp->fh_dentry) {
572
+ if (!newfhp->fh_path.dentry) {
574
"nfsd_proc_create: file handle not verified\n");
579
- inode = newfhp->fh_dentry->d_inode;
580
+ inode = newfhp->fh_path.dentry->d_inode;
582
/* Unfudge the mode bits */
583
if (attr->ia_valid & ATTR_MODE) {
584
@@ -286,9 +275,10 @@ nfsd_proc_create(struct svc_rqst *rqstp,
585
* echo thing > device-special-file-or-pipe
586
* by doing a CREATE with type==0
588
- nfserr = nfsd_permission(newfhp->fh_export,
590
- MAY_WRITE|MAY_LOCAL_ACCESS);
591
+ nfserr = nfsd_permission(
593
+ newfhp->fh_path.dentry,
594
+ MAY_WRITE|MAY_LOCAL_ACCESS);
595
if (nfserr && nfserr != nfserr_rofs)
598
@@ -448,7 +438,7 @@ nfsd_proc_mkdir(struct svc_rqst *rqstp,
600
dprintk("nfsd: MKDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
602
- if (resp->fh.fh_dentry) {
603
+ if (resp->fh.fh_path.dentry) {
605
"nfsd_proc_mkdir: response already verified??\n");
607
Index: linux-2.6/fs/nfsd/nfsxdr.c
608
===================================================================
609
--- linux-2.6.orig/fs/nfsd/nfsxdr.c
610
+++ linux-2.6/fs/nfsd/nfsxdr.c
611
@@ -150,7 +150,7 @@ static __be32 *
612
encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp,
615
- struct dentry *dentry = fhp->fh_dentry;
616
+ struct dentry *dentry = fhp->fh_path.dentry;
618
struct timespec time;
620
@@ -193,11 +193,8 @@ encode_fattr(struct svc_rqst *rqstp, __b
621
__be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
626
- path.mnt = fhp->fh_export->ex_mnt;
627
- path.dentry = fhp->fh_dentry;
628
- vfs_getattr(&path, &stat);
629
+ vfs_getattr(&fhp->fh_path, &stat);
630
return encode_fattr(rqstp, p, fhp, &stat);
633
Index: linux-2.6/fs/nfsd/vfs.c
634
===================================================================
635
--- linux-2.6.orig/fs/nfsd/vfs.c
636
+++ linux-2.6/fs/nfsd/vfs.c
637
@@ -165,7 +165,7 @@ nfsd_lookup(struct svc_rqst *rqstp, stru
641
- dparent = fhp->fh_dentry;
642
+ dparent = fhp->fh_path.dentry;
643
exp = fhp->fh_export;
646
@@ -268,7 +268,7 @@ nfsd_setattr(struct svc_rqst *rqstp, str
650
- dentry = fhp->fh_dentry;
651
+ dentry = fhp->fh_path.dentry;
652
inode = dentry->d_inode;
654
/* Ignore any mode updates on symlinks */
655
@@ -438,7 +438,7 @@ nfsd4_set_nfs4_acl(struct svc_rqst *rqst
659
- dentry = fhp->fh_dentry;
660
+ dentry = fhp->fh_path.dentry;
661
inode = dentry->d_inode;
662
if (S_ISDIR(inode->i_mode))
663
flags = NFS4_ACL_DIR;
664
@@ -588,7 +588,7 @@ nfsd_access(struct svc_rqst *rqstp, stru
667
export = fhp->fh_export;
668
- dentry = fhp->fh_dentry;
669
+ dentry = fhp->fh_path.dentry;
671
if (S_ISREG(dentry->d_inode->i_mode))
672
map = nfs3_regaccess;
673
@@ -659,7 +659,7 @@ nfsd_open(struct svc_rqst *rqstp, struct
677
- dentry = fhp->fh_dentry;
678
+ dentry = fhp->fh_path.dentry;
679
inode = dentry->d_inode;
681
/* Disallow write access to files with the append-only bit set
682
@@ -1016,7 +1016,7 @@ nfsd_read(struct svc_rqst *rqstp, struct
686
- err = nfsd_permission(fhp->fh_export, fhp->fh_dentry,
687
+ err = nfsd_permission(fhp->fh_export, fhp->fh_path.dentry,
688
MAY_READ|MAY_OWNER_OVERRIDE);
691
@@ -1045,7 +1045,7 @@ nfsd_write(struct svc_rqst *rqstp, struc
695
- err = nfsd_permission(fhp->fh_export, fhp->fh_dentry,
696
+ err = nfsd_permission(fhp->fh_export, fhp->fh_path.dentry,
697
MAY_WRITE|MAY_OWNER_OVERRIDE);
700
@@ -1128,7 +1128,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
704
- dentry = fhp->fh_dentry;
705
+ dentry = fhp->fh_path.dentry;
706
dirp = dentry->d_inode;
709
@@ -1138,7 +1138,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
710
* Check whether the response file handle has been verified yet.
711
* If it has, the parent directory should already be locked.
713
- if (!resfhp->fh_dentry) {
714
+ if (!resfhp->fh_path.dentry) {
715
/* called from nfsd_proc_mkdir, or possibly nfsd3_proc_create */
716
fh_lock_nested(fhp, I_MUTEX_PARENT);
717
dchild = lookup_one_len(fname, dentry, flen);
718
@@ -1150,7 +1150,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
721
/* called from nfsd_proc_create */
722
- dchild = dget(resfhp->fh_dentry);
723
+ dchild = dget(resfhp->fh_path.dentry);
724
if (!fhp->fh_locked) {
725
/* not actually possible */
727
@@ -1258,7 +1258,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, s
731
- dentry = fhp->fh_dentry;
732
+ dentry = fhp->fh_path.dentry;
733
dirp = dentry->d_inode;
735
/* Get all the sanity checks out of the way before
736
@@ -1391,7 +1391,7 @@ nfsd_readlink(struct svc_rqst *rqstp, st
740
- dentry = fhp->fh_dentry;
741
+ dentry = fhp->fh_path.dentry;
742
inode = dentry->d_inode;
745
@@ -1446,7 +1446,7 @@ nfsd_symlink(struct svc_rqst *rqstp, str
749
- dentry = fhp->fh_dentry;
750
+ dentry = fhp->fh_path.dentry;
751
dnew = lookup_one_len(fname, dentry, flen);
752
host_err = PTR_ERR(dnew);
754
@@ -1516,7 +1516,7 @@ nfsd_link(struct svc_rqst *rqstp, struct
757
fh_lock_nested(ffhp, I_MUTEX_PARENT);
758
- ddir = ffhp->fh_dentry;
759
+ ddir = ffhp->fh_path.dentry;
760
dirp = ddir->d_inode;
762
dnew = lookup_one_len(name, ddir, len);
763
@@ -1524,7 +1524,7 @@ nfsd_link(struct svc_rqst *rqstp, struct
767
- dold = tfhp->fh_dentry;
768
+ dold = tfhp->fh_path.dentry;
769
dest = dold->d_inode;
771
host_err = vfs_link(dold, dirp, dnew);
772
@@ -1572,10 +1572,10 @@ nfsd_rename(struct svc_rqst *rqstp, stru
776
- fdentry = ffhp->fh_dentry;
777
+ fdentry = ffhp->fh_path.dentry;
778
fdir = fdentry->d_inode;
780
- tdentry = tfhp->fh_dentry;
781
+ tdentry = tfhp->fh_path.dentry;
782
tdir = tdentry->d_inode;
784
err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev;
785
@@ -1668,7 +1668,7 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
788
fh_lock_nested(fhp, I_MUTEX_PARENT);
789
- dentry = fhp->fh_dentry;
790
+ dentry = fhp->fh_path.dentry;
791
dirp = dentry->d_inode;
793
rdentry = lookup_one_len(fname, dentry, flen);
794
@@ -1765,7 +1765,7 @@ __be32
795
nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat)
797
__be32 err = fh_verify(rqstp, fhp, 0, MAY_NOP);
798
- if (!err && vfs_statfs(fhp->fh_dentry,stat))
799
+ if (!err && vfs_statfs(fhp->fh_path.dentry,stat))
803
@@ -1904,7 +1904,7 @@ nfsd_racache_init(int cache_size)
805
nfsd_get_posix_acl(struct svc_fh *fhp, int type)
807
- struct inode *inode = fhp->fh_dentry->d_inode;
808
+ struct inode *inode = fhp->fh_path.dentry->d_inode;
812
@@ -1924,7 +1924,7 @@ nfsd_get_posix_acl(struct svc_fh *fhp, i
813
return ERR_PTR(-EOPNOTSUPP);
816
- size = nfsd_getxattr(fhp->fh_dentry, name, &value);
817
+ size = nfsd_getxattr(fhp->fh_path.dentry, name, &value);
819
return ERR_PTR(size);
821
@@ -1936,7 +1936,7 @@ nfsd_get_posix_acl(struct svc_fh *fhp, i
823
nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl)
825
- struct inode *inode = fhp->fh_dentry->d_inode;
826
+ struct inode *inode = fhp->fh_path.dentry->d_inode;
830
@@ -1969,12 +1969,12 @@ nfsd_set_posix_acl(struct svc_fh *fhp, i
834
- error = vfs_setxattr(fhp->fh_dentry, name, value, size, 0);
835
+ error = vfs_setxattr(fhp->fh_path.dentry, name, value, size, 0);
837
if (!S_ISDIR(inode->i_mode) && type == ACL_TYPE_DEFAULT)
840
- error = vfs_removexattr(fhp->fh_dentry, name);
841
+ error = vfs_removexattr(fhp->fh_path.dentry, name);
842
if (error == -ENODATA)
845
Index: linux-2.6/include/linux/nfsd/nfsfh.h
846
===================================================================
847
--- linux-2.6.orig/include/linux/nfsd/nfsfh.h
848
+++ linux-2.6/include/linux/nfsd/nfsfh.h
849
@@ -134,7 +134,7 @@ static inline ino_t u32_to_ino_t(__u32 u
851
typedef struct svc_fh {
852
struct knfsd_fh fh_handle; /* FH data */
853
- struct dentry * fh_dentry; /* validated dentry */
854
+ struct path fh_path; /* validated path */
855
struct svc_export * fh_export; /* export pointer */
856
int fh_maxsize; /* max size for fh_handle */
858
@@ -217,7 +217,7 @@ void fh_put(struct svc_fh *);
859
static __inline__ struct svc_fh *
860
fh_copy(struct svc_fh *dst, struct svc_fh *src)
862
- WARN_ON(src->fh_dentry || src->fh_locked);
863
+ WARN_ON(src->fh_path.dentry || src->fh_locked);
867
@@ -240,7 +240,7 @@ fill_pre_wcc(struct svc_fh *fhp)
871
- inode = fhp->fh_dentry->d_inode;
872
+ inode = fhp->fh_path.dentry->d_inode;
873
if (!fhp->fh_pre_saved) {
874
fhp->fh_pre_mtime = inode->i_mtime;
875
fhp->fh_pre_ctime = inode->i_ctime;
876
@@ -255,7 +255,7 @@ fill_pre_wcc(struct svc_fh *fhp)
878
fill_post_wcc(struct svc_fh *fhp)
880
- struct inode *inode = fhp->fh_dentry->d_inode;
881
+ struct inode *inode = fhp->fh_path.dentry->d_inode;
883
if (fhp->fh_post_saved)
884
printk("nfsd: inode locked twice during operation.\n");
885
@@ -290,7 +290,7 @@ fill_post_wcc(struct svc_fh *fhp)
887
fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
889
- struct dentry *dentry = fhp->fh_dentry;
890
+ struct dentry *dentry = fhp->fh_path.dentry;
893
dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
894
@@ -322,11 +322,11 @@ fh_lock(struct svc_fh *fhp)
896
fh_unlock(struct svc_fh *fhp)
898
- BUG_ON(!fhp->fh_dentry);
899
+ BUG_ON(!fhp->fh_path.dentry);
901
if (fhp->fh_locked) {
903
- mutex_unlock(&fhp->fh_dentry->d_inode->i_mutex);
904
+ mutex_unlock(&fhp->fh_path.dentry->d_inode->i_mutex);
908
Index: linux-2.6/include/linux/nfsd/xdr4.h
909
===================================================================
910
--- linux-2.6.orig/include/linux/nfsd/xdr4.h
911
+++ linux-2.6/include/linux/nfsd/xdr4.h
912
@@ -433,7 +433,7 @@ int nfs4svc_encode_compoundres(struct sv
913
void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
914
void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op);
915
__be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
916
- struct dentry *dentry, __be32 *buffer, int *countp,
917
+ struct path *path, __be32 *buffer, int *countp,
918
u32 *bmval, struct svc_rqst *);
919
extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
920
struct nfsd4_compound_state *,