~ubuntu-branches/ubuntu/quantal/apparmor/quantal-updates

« back to all changes in this revision

Viewing changes to kernel-patches/for-mainline/struct_path/struct_path-nfsfh.diff

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-03-23 16:42:01 UTC
  • Revision ID: james.westby@ubuntu.com-20070323164201-jkax6f0oku087b7l
Tags: upstream-2.0.1+510.dfsg
ImportĀ upstreamĀ versionĀ 2.0.1+510.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
6
                if (acl == NULL) {
 
7
                        /* Solaris returns the inode's minimum ACL. */
 
8
 
 
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);
 
12
                }
 
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)
 
17
 {
 
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;
 
22
        unsigned int base;
 
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
 
28
                if (acl == NULL) {
 
29
                        /* Solaris returns the inode's minimum ACL. */
 
30
 
 
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);
 
34
                }
 
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)
 
39
 {
 
40
-       struct dentry *dentry = resp->fh.fh_dentry;
 
41
+       struct dentry *dentry = resp->fh.fh_path.dentry;
 
42
 
 
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
 
50
 {
 
51
        int     err;
 
52
        __be32  nfserr;
 
53
-       struct path path;
 
54
 
 
55
        dprintk("nfsd: GETATTR(3)  %s\n",
 
56
                SVCFH_fmt(&argp->fh));
 
57
@@ -68,9 +67,7 @@ nfsd3_proc_getattr(struct svc_rqst *rqst
 
58
        if (nfserr)
 
59
                RETURN_STATUS(nfserr);
 
60
 
 
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);
 
66
 
 
67
        RETURN_STATUS(nfserr);
 
68
@@ -187,7 +184,7 @@ nfsd3_proc_read(struct svc_rqst *rqstp, 
 
69
                                  rqstp->rq_vec, argp->vlen,
 
70
                                  &resp->count);
 
71
        if (nfserr == 0) {
 
72
-               struct inode    *inode = resp->fh.fh_dentry->d_inode;
 
73
+               struct inode    *inode = resp->fh.fh_path.dentry->d_inode;
 
74
 
 
75
                resp->eof = (argp->offset + resp->count) >= inode->i_size;
 
76
        }
 
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 */
 
80
        if (nfserr == 0) {
 
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;
 
83
 
 
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);
 
88
 
 
89
        if (nfserr == 0) {
 
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;
 
92
 
 
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,
 
101
              struct kstat *stat)
 
102
 {
 
103
-       struct dentry   *dentry = fhp->fh_dentry;
 
104
+       struct dentry   *dentry = fhp->fh_path.dentry;
 
105
        struct timespec time;
 
106
 
 
107
        *p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]);
 
108
@@ -185,7 +185,7 @@ encode_fattr3(struct svc_rqst *rqstp, __
 
109
 static __be32 *
 
110
 encode_saved_post_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
 
111
 {
 
112
-       struct inode    *inode = fhp->fh_dentry->d_inode;
 
113
+       struct inode    *inode = fhp->fh_path.dentry->d_inode;
 
114
 
 
115
        /* Attributes to follow */
 
116
        *p++ = xdr_one;
 
117
@@ -223,15 +223,13 @@ encode_saved_post_attr(struct svc_rqst *
 
118
 static __be32 *
 
119
 encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
 
120
 {
 
121
-       struct path path;
 
122
+       struct dentry *dentry = fhp->fh_path.dentry;
 
123
 
 
124
-       path.dentry = fhp->fh_dentry;
 
125
-       if (path.dentry && path.dentry->d_inode != NULL) {
 
126
+       if (dentry && dentry->d_inode != NULL) {
 
127
                int err;
 
128
                struct kstat stat;
 
129
 
 
130
-               path.mnt = fhp->fh_export->ex_mnt;
 
131
-               err = vfs_getattr(&path, &stat);
 
132
+               err = vfs_getattr(&fhp->fh_path, &stat);
 
133
                if (!err) {
 
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
 
137
 static __be32 *
 
138
 encode_wcc_data(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
 
139
 {
 
140
-       struct dentry   *dentry = fhp->fh_dentry;
 
141
+       struct dentry   *dentry = fhp->fh_path.dentry;
 
142
 
 
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;
 
147
        int rv = 0;
 
148
 
 
149
-       dparent = cd->fh.fh_dentry;
 
150
+       dparent = cd->fh.fh_path.dentry;
 
151
        exp  = cd->fh.fh_export;
 
152
 
 
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)
 
160
 {
 
161
        fh_put(dst);
 
162
-       dget(src->fh_dentry);
 
163
+       dget(src->fh_path.dentry);
 
164
        if (src->fh_export)
 
165
                cache_get(&src->fh_export->h);
 
166
        *dst = *src;
 
167
@@ -261,7 +261,7 @@ static __be32
 
168
 nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 
169
            struct svc_fh **getfh)
 
170
 {
 
171
-       if (!cstate->current_fh.fh_dentry)
 
172
+       if (!cstate->current_fh.fh_path.dentry)
 
173
                return nfserr_nofilehandle;
 
174
 
 
175
        *getfh = &cstate->current_fh;
 
176
@@ -295,7 +295,7 @@ static __be32
 
177
 nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 
178
                void *arg)
 
179
 {
 
180
-       if (!cstate->save_fh.fh_dentry)
 
181
+       if (!cstate->save_fh.fh_path.dentry)
 
182
                return nfserr_restorefh;
 
183
 
 
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,
 
187
             void *arg)
 
188
 {
 
189
-       if (!cstate->current_fh.fh_dentry)
 
190
+       if (!cstate->current_fh.fh_path.dentry)
 
191
                return nfserr_nofilehandle;
 
192
 
 
193
        fh_dup2(&cstate->save_fh, &cstate->current_fh);
 
194
@@ -457,7 +457,7 @@ nfsd4_link(struct svc_rqst *rqstp, struc
 
195
 {
 
196
        __be32 status = nfserr_nofilehandle;
 
197
 
 
198
-       if (!cstate->save_fh.fh_dentry)
 
199
+       if (!cstate->save_fh.fh_path.dentry)
 
200
                return status;
 
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)
 
206
                return ret;
 
207
-       if (tmp_fh.fh_dentry == cstate->current_fh.fh_dentry) {
 
208
+       if (tmp_fh.fh_path.dentry == cstate->current_fh.fh_path.dentry) {
 
209
                fh_put(&tmp_fh);
 
210
                return nfserr_noent;
 
211
        }
 
212
@@ -583,7 +583,7 @@ nfsd4_rename(struct svc_rqst *rqstp, str
 
213
 {
 
214
        __be32 status = nfserr_nofilehandle;
 
215
 
 
216
-       if (!cstate->save_fh.fh_dentry)
 
217
+       if (!cstate->save_fh.fh_path.dentry)
 
218
                return status;
 
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
 
233
 
 
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,
 
239
                                    rqstp);
 
240
 
 
241
@@ -876,7 +876,7 @@ nfsd4_proc_compound(struct svc_rqst *rqs
 
242
 
 
243
                opdesc = &nfsd4_ops[op->opnum];
 
244
 
 
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;
 
249
                                goto encode_op;
 
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
 
255
 static __be32
 
256
 nfs4_share_conflict(struct svc_fh *current_fh, unsigned int deny_type)
 
257
 {
 
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;
 
262
        __be32 ret;
 
263
@@ -1745,7 +1745,7 @@ __be32
 
264
 nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
 
265
 {
 
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;
 
271
        __be32 status;
 
272
@@ -1969,7 +1969,7 @@ search_close_lru(u32 st_id, int flags)
 
273
 static inline int
 
274
 nfs4_check_fh(struct svc_fh *fhp, struct nfs4_stateid *stp)
 
275
 {
 
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;
 
278
 }
 
279
 
 
280
 static int
 
281
@@ -2052,7 +2052,7 @@ nfs4_preprocess_stateid_op(struct svc_fh
 
282
        struct nfs4_stateid *stp = NULL;
 
283
        struct nfs4_delegation *dp = NULL;
 
284
        stateid_t *stidp;
 
285
-       struct inode *ino = current_fh->fh_dentry->d_inode;
 
286
+       struct inode *ino = current_fh->fh_path.dentry->d_inode;
 
287
        __be32 status;
 
288
 
 
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;
 
292
 
 
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);
 
298
 
 
299
        status = fh_verify(rqstp, &cstate->current_fh, S_IFREG, 0);
 
300
        if (status)
 
301
@@ -2324,8 +2324,8 @@ nfsd4_open_downgrade(struct svc_rqst *rq
 
302
        unsigned int share_access;
 
303
 
 
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);
 
309
 
 
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;
 
314
 
 
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);
 
320
 
 
321
        nfs4_lock_state();
 
322
        /* check close_lru for replay */
 
323
@@ -2837,7 +2837,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, stru
 
324
                goto out;
 
325
        }
 
326
 
 
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) {
 
331
                case NFS4_READ_LT:
 
332
@@ -2876,7 +2876,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, stru
 
333
         * only the dentry:inode set.
 
334
         */
 
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;
 
338
 
 
339
        status = nfs_ok;
 
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
 
346
  */
 
347
 __be32
 
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)
 
352
 {
 
353
        u32 bmval0 = bmval[0];
 
354
@@ -1442,7 +1442,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
 
355
        int err;
 
356
        int aclsupport = 0;
 
357
        struct nfs4_acl *acl = NULL;
 
358
-       struct path path;
 
359
+       struct dentry *dentry = path->dentry;
 
360
 
 
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
 
364
                        goto out;
 
365
        }
 
366
 
 
367
-       path.mnt = exp->ex_mnt;
 
368
-       path.dentry = dentry;
 
369
-       err = vfs_getattr(&path, &stat);
 
370
+       err = vfs_getattr(path, &stat);
 
371
        if (err)
 
372
                goto out_nfserr;
 
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)
 
376
 {
 
377
        struct svc_export *exp = cd->rd_fhp->fh_export;
 
378
-       struct dentry *dentry;
 
379
+       struct path path;
 
380
        __be32 nfserr;
 
381
 
 
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));
 
388
 
 
389
        exp_get(exp);
 
390
-       if (d_mountpoint(dentry)) {
 
391
+       if (d_mountpoint(path.dentry)) {
 
392
                int err;
 
393
 
 
394
-               err = nfsd_cross_mnt(cd->rd_rqstp, &dentry, &exp);
 
395
+               err = nfsd_cross_mnt(cd->rd_rqstp, &path.dentry, &exp);
 
396
                if (err) {
 
397
                        nfserr = nfserrno(err);
 
398
                        goto out_put;
 
399
                }
 
400
 
 
401
        }
 
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,
 
405
                                        cd->rd_rqstp);
 
406
 out_put:
 
407
-       dput(dentry);
 
408
+       dput(path.dentry);
 
409
        exp_put(exp);
 
410
        return nfserr;
 
411
 }
 
412
@@ -2010,7 +2009,7 @@ nfsd4_encode_getattr(struct nfsd4_compou
 
413
                return nfserr;
 
414
 
 
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,
 
419
                                    resp->rqstp);
 
420
        if (!nfserr)
 
421
@@ -2248,7 +2247,7 @@ nfsd4_encode_read(struct nfsd4_compoundr
 
422
        if (nfserr)
 
423
                return nfserr;
 
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);
 
427
 
 
428
        WRITE32(eof);
 
429
        WRITE32(maxcount);
 
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;
 
437
 
 
438
-       if (!fhp->fh_dentry) {
 
439
+       if (!fhp->fh_path.dentry) {
 
440
                __u32 *datap=NULL;
 
441
                __u32 tfh[3];           /* filehandle fragment for oldstyle filehandles */
 
442
                int fileid_type;
 
443
@@ -238,7 +238,7 @@ fh_verify(struct svc_rqst *rqstp, struct
 
444
                }
 
445
 #endif
 
446
 
 
447
-               fhp->fh_dentry = dentry;
 
448
+               fhp->fh_path.dentry = dentry;
 
449
                fhp->fh_export = exp;
 
450
                nfsd_nr_verified++;
 
451
        } else {
 
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)
 
454
                 */
 
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
 
462
        if (ref_fh == fhp)
 
463
                fh_put(ref_fh);
 
464
 
 
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);
 
469
        }
 
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);
 
473
 
 
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;
 
478
        cache_get(&exp->h);
 
479
 
 
480
@@ -459,10 +460,10 @@ fh_update(struct svc_fh *fhp)
 
481
        struct dentry *dentry;
 
482
        __u32 *datap;
 
483
        
 
484
-       if (!fhp->fh_dentry)
 
485
+       if (!fhp->fh_path.dentry)
 
486
                goto out_bad;
 
487
 
 
488
-       dentry = fhp->fh_dentry;
 
489
+       dentry = fhp->fh_path.dentry;
 
490
        if (!dentry->d_inode)
 
491
                goto out_negative;
 
492
        if (fhp->fh_handle.fh_version != 1) {
 
493
@@ -498,11 +499,11 @@ out_negative:
 
494
 void
 
495
 fh_put(struct svc_fh *fhp)
 
496
 {
 
497
-       struct dentry * dentry = fhp->fh_dentry;
 
498
+       struct dentry * dentry = fhp->fh_path.dentry;
 
499
        struct svc_export * exp = fhp->fh_export;
 
500
        if (dentry) {
 
501
                fh_unlock(fhp);
 
502
-               fhp->fh_dentry = NULL;
 
503
+               fhp->fh_path.dentry = NULL;
 
504
                dput(dentry);
 
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
 
512
 static __be32
 
513
 nfsd_return_attrs(__be32 err, struct nfsd_attrstat *resp)
 
514
 {
 
515
-       struct path path;
 
516
-
 
517
        if (err)
 
518
                return err;
 
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));
 
523
 }
 
524
 
 
525
 static __be32
 
526
 nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp)
 
527
 {
 
528
-       struct path path;
 
529
-
 
530
        if (err)
 
531
                return err;
 
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));
 
536
 }
 
537
 /*
 
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)
 
542
 {
 
543
-       struct path path;
 
544
        __be32  nfserr;
 
545
 
 
546
        dprintk("nfsd: READ    %s %d bytes at %d\n",
 
547
@@ -172,9 +163,7 @@ nfsd_proc_read(struct svc_rqst *rqstp, s
 
548
 
 
549
        if (nfserr)
 
550
                return nfserr;
 
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));
 
555
 }
 
556
 
 
557
 /*
 
558
@@ -236,7 +225,7 @@ nfsd_proc_create(struct svc_rqst *rqstp,
 
559
        if (isdotent(argp->name, argp->len))
 
560
                goto done;
 
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));
 
566
                goto out_unlock;
 
567
@@ -254,14 +243,14 @@ nfsd_proc_create(struct svc_rqst *rqstp,
 
568
                 * whether the file exists or not. Time to bail ...
 
569
                 */
 
570
                nfserr = nfserr_acces;
 
571
-               if (!newfhp->fh_dentry) {
 
572
+               if (!newfhp->fh_path.dentry) {
 
573
                        printk(KERN_WARNING 
 
574
                                "nfsd_proc_create: file handle not verified\n");
 
575
                        goto out_unlock;
 
576
                }
 
577
        }
 
578
 
 
579
-       inode = newfhp->fh_dentry->d_inode;
 
580
+       inode = newfhp->fh_path.dentry->d_inode;
 
581
 
 
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
 
587
                                         */
 
588
-                                       nfserr = nfsd_permission(newfhp->fh_export,
 
589
-                                                                newfhp->fh_dentry,
 
590
-                                                                MAY_WRITE|MAY_LOCAL_ACCESS);
 
591
+                                       nfserr = nfsd_permission(
 
592
+                                               newfhp->fh_export,
 
593
+                                               newfhp->fh_path.dentry,
 
594
+                                               MAY_WRITE|MAY_LOCAL_ACCESS);
 
595
                                        if (nfserr && nfserr != nfserr_rofs)
 
596
                                                goto out_unlock;
 
597
                                }
 
598
@@ -448,7 +438,7 @@ nfsd_proc_mkdir(struct svc_rqst *rqstp, 
 
599
 
 
600
        dprintk("nfsd: MKDIR    %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
 
601
 
 
602
-       if (resp->fh.fh_dentry) {
 
603
+       if (resp->fh.fh_path.dentry) {
 
604
                printk(KERN_WARNING
 
605
                        "nfsd_proc_mkdir: response already verified??\n");
 
606
        }
 
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,
 
613
             struct kstat *stat)
 
614
 {
 
615
-       struct dentry   *dentry = fhp->fh_dentry;
 
616
+       struct dentry   *dentry = fhp->fh_path.dentry;
 
617
        int type;
 
618
        struct timespec time;
 
619
 
 
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)
 
622
 {
 
623
        struct kstat stat;
 
624
-       struct path path;
 
625
 
 
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);
 
631
 }
 
632
 
 
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
 
638
        if (err)
 
639
                return err;
 
640
 
 
641
-       dparent = fhp->fh_dentry;
 
642
+       dparent = fhp->fh_path.dentry;
 
643
        exp  = fhp->fh_export;
 
644
        exp_get(exp);
 
645
 
 
646
@@ -268,7 +268,7 @@ nfsd_setattr(struct svc_rqst *rqstp, str
 
647
        if (err)
 
648
                goto out;
 
649
 
 
650
-       dentry = fhp->fh_dentry;
 
651
+       dentry = fhp->fh_path.dentry;
 
652
        inode = dentry->d_inode;
 
653
 
 
654
        /* Ignore any mode updates on symlinks */
 
655
@@ -438,7 +438,7 @@ nfsd4_set_nfs4_acl(struct svc_rqst *rqst
 
656
        if (error)
 
657
                goto out;
 
658
 
 
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
 
665
                goto out;
 
666
 
 
667
        export = fhp->fh_export;
 
668
-       dentry = fhp->fh_dentry;
 
669
+       dentry = fhp->fh_path.dentry;
 
670
 
 
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
 
674
        if (err)
 
675
                goto out;
 
676
 
 
677
-       dentry = fhp->fh_dentry;
 
678
+       dentry = fhp->fh_path.dentry;
 
679
        inode = dentry->d_inode;
 
680
 
 
681
        /* Disallow write access to files with the append-only bit set
 
682
@@ -1016,7 +1016,7 @@ nfsd_read(struct svc_rqst *rqstp, struct
 
683
        __be32          err;
 
684
 
 
685
        if (file) {
 
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);
 
689
                if (err)
 
690
                        goto out;
 
691
@@ -1045,7 +1045,7 @@ nfsd_write(struct svc_rqst *rqstp, struc
 
692
        __be32                  err = 0;
 
693
 
 
694
        if (file) {
 
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);
 
698
                if (err)
 
699
                        goto out;
 
700
@@ -1128,7 +1128,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
 
701
        if (err)
 
702
                goto out;
 
703
 
 
704
-       dentry = fhp->fh_dentry;
 
705
+       dentry = fhp->fh_path.dentry;
 
706
        dirp = dentry->d_inode;
 
707
 
 
708
        err = nfserr_notdir;
 
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.
 
712
         */
 
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
 
719
                        goto out;
 
720
        } else {
 
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 */
 
726
                        printk(KERN_ERR
 
727
@@ -1258,7 +1258,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, s
 
728
        if (err)
 
729
                goto out;
 
730
 
 
731
-       dentry = fhp->fh_dentry;
 
732
+       dentry = fhp->fh_path.dentry;
 
733
        dirp = dentry->d_inode;
 
734
 
 
735
        /* Get all the sanity checks out of the way before
 
736
@@ -1391,7 +1391,7 @@ nfsd_readlink(struct svc_rqst *rqstp, st
 
737
        if (err)
 
738
                goto out;
 
739
 
 
740
-       dentry = fhp->fh_dentry;
 
741
+       dentry = fhp->fh_path.dentry;
 
742
        inode = dentry->d_inode;
 
743
 
 
744
        err = nfserr_inval;
 
745
@@ -1446,7 +1446,7 @@ nfsd_symlink(struct svc_rqst *rqstp, str
 
746
        if (err)
 
747
                goto out;
 
748
        fh_lock(fhp);
 
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);
 
753
        if (IS_ERR(dnew))
 
754
@@ -1516,7 +1516,7 @@ nfsd_link(struct svc_rqst *rqstp, struct
 
755
                goto out;
 
756
 
 
757
        fh_lock_nested(ffhp, I_MUTEX_PARENT);
 
758
-       ddir = ffhp->fh_dentry;
 
759
+       ddir = ffhp->fh_path.dentry;
 
760
        dirp = ddir->d_inode;
 
761
 
 
762
        dnew = lookup_one_len(name, ddir, len);
 
763
@@ -1524,7 +1524,7 @@ nfsd_link(struct svc_rqst *rqstp, struct
 
764
        if (IS_ERR(dnew))
 
765
                goto out_nfserr;
 
766
 
 
767
-       dold = tfhp->fh_dentry;
 
768
+       dold = tfhp->fh_path.dentry;
 
769
        dest = dold->d_inode;
 
770
 
 
771
        host_err = vfs_link(dold, dirp, dnew);
 
772
@@ -1572,10 +1572,10 @@ nfsd_rename(struct svc_rqst *rqstp, stru
 
773
        if (err)
 
774
                goto out;
 
775
 
 
776
-       fdentry = ffhp->fh_dentry;
 
777
+       fdentry = ffhp->fh_path.dentry;
 
778
        fdir = fdentry->d_inode;
 
779
 
 
780
-       tdentry = tfhp->fh_dentry;
 
781
+       tdentry = tfhp->fh_path.dentry;
 
782
        tdir = tdentry->d_inode;
 
783
 
 
784
        err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev;
 
785
@@ -1668,7 +1668,7 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
 
786
                goto out;
 
787
 
 
788
        fh_lock_nested(fhp, I_MUTEX_PARENT);
 
789
-       dentry = fhp->fh_dentry;
 
790
+       dentry = fhp->fh_path.dentry;
 
791
        dirp = dentry->d_inode;
 
792
 
 
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)
 
796
 {
 
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))
 
800
                err = nfserr_io;
 
801
        return err;
 
802
 }
 
803
@@ -1904,7 +1904,7 @@ nfsd_racache_init(int cache_size)
 
804
 struct posix_acl *
 
805
 nfsd_get_posix_acl(struct svc_fh *fhp, int type)
 
806
 {
 
807
-       struct inode *inode = fhp->fh_dentry->d_inode;
 
808
+       struct inode *inode = fhp->fh_path.dentry->d_inode;
 
809
        char *name;
 
810
        void *value = NULL;
 
811
        ssize_t size;
 
812
@@ -1924,7 +1924,7 @@ nfsd_get_posix_acl(struct svc_fh *fhp, i
 
813
                return ERR_PTR(-EOPNOTSUPP);
 
814
        }
 
815
 
 
816
-       size = nfsd_getxattr(fhp->fh_dentry, name, &value);
 
817
+       size = nfsd_getxattr(fhp->fh_path.dentry, name, &value);
 
818
        if (size < 0)
 
819
                return ERR_PTR(size);
 
820
 
 
821
@@ -1936,7 +1936,7 @@ nfsd_get_posix_acl(struct svc_fh *fhp, i
 
822
 int
 
823
 nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl)
 
824
 {
 
825
-       struct inode *inode = fhp->fh_dentry->d_inode;
 
826
+       struct inode *inode = fhp->fh_path.dentry->d_inode;
 
827
        char *name;
 
828
        void *value = NULL;
 
829
        size_t size;
 
830
@@ -1969,12 +1969,12 @@ nfsd_set_posix_acl(struct svc_fh *fhp, i
 
831
                size = 0;
 
832
 
 
833
        if (size)
 
834
-               error = vfs_setxattr(fhp->fh_dentry, name, value, size, 0);
 
835
+               error = vfs_setxattr(fhp->fh_path.dentry, name, value, size, 0);
 
836
        else {
 
837
                if (!S_ISDIR(inode->i_mode) && type == ACL_TYPE_DEFAULT)
 
838
                        error = 0;
 
839
                else {
 
840
-                       error = vfs_removexattr(fhp->fh_dentry, name);
 
841
+                       error = vfs_removexattr(fhp->fh_path.dentry, name);
 
842
                        if (error == -ENODATA)
 
843
                                error = 0;
 
844
                }
 
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
 
850
  */
 
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 */
 
857
 
 
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)
 
861
 {
 
862
-       WARN_ON(src->fh_dentry || src->fh_locked);
 
863
+       WARN_ON(src->fh_path.dentry || src->fh_locked);
 
864
                        
 
865
        *dst = *src;
 
866
        return dst;
 
867
@@ -240,7 +240,7 @@ fill_pre_wcc(struct svc_fh *fhp)
 
868
 {
 
869
        struct inode    *inode;
 
870
 
 
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)
 
877
 static inline void
 
878
 fill_post_wcc(struct svc_fh *fhp)
 
879
 {
 
880
-       struct inode    *inode = fhp->fh_dentry->d_inode;
 
881
+       struct inode    *inode = fhp->fh_path.dentry->d_inode;
 
882
 
 
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)
 
886
 static inline void
 
887
 fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
 
888
 {
 
889
-       struct dentry   *dentry = fhp->fh_dentry;
 
890
+       struct dentry   *dentry = fhp->fh_path.dentry;
 
891
        struct inode    *inode;
 
892
 
 
893
        dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
 
894
@@ -322,11 +322,11 @@ fh_lock(struct svc_fh *fhp)
 
895
 static inline void
 
896
 fh_unlock(struct svc_fh *fhp)
 
897
 {
 
898
-       BUG_ON(!fhp->fh_dentry);
 
899
+       BUG_ON(!fhp->fh_path.dentry);
 
900
 
 
901
        if (fhp->fh_locked) {
 
902
                fill_post_wcc(fhp);
 
903
-               mutex_unlock(&fhp->fh_dentry->d_inode->i_mutex);
 
904
+               mutex_unlock(&fhp->fh_path.dentry->d_inode->i_mutex);
 
905
                fhp->fh_locked = 0;
 
906
        }
 
907
 }
 
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 *,