1
Index: linux-2.6/drivers/block/loop.c
2
===================================================================
3
--- linux-2.6.orig/drivers/block/loop.c
4
+++ linux-2.6/drivers/block/loop.c
5
@@ -1000,7 +1000,7 @@ loop_get_status(struct loop_device *lo,
7
if (lo->lo_state != Lo_bound)
9
- error = vfs_getattr(file->f_path.mnt, file->f_path.dentry, &stat);
10
+ error = vfs_getattr(&file->f_path, &stat);
13
memset(info, 0, sizeof(*info));
14
Index: linux-2.6/fs/gfs2/ops_fstype.c
15
===================================================================
16
--- linux-2.6.orig/fs/gfs2/ops_fstype.c
17
+++ linux-2.6/fs/gfs2/ops_fstype.c
18
@@ -827,7 +827,7 @@ static struct super_block* get_gfs2_sb(c
22
- error = vfs_getattr(nd.path.mnt, nd.path.dentry, &stat);
23
+ error = vfs_getattr(&nd.path, &stat);
25
fstype = get_fs_type("gfs2");
26
list_for_each(l, &fstype->fs_supers) {
27
Index: linux-2.6/fs/nfsd/nfs3proc.c
28
===================================================================
29
--- linux-2.6.orig/fs/nfsd/nfs3proc.c
30
+++ linux-2.6/fs/nfsd/nfs3proc.c
31
@@ -58,6 +58,7 @@ nfsd3_proc_getattr(struct svc_rqst *rqst
37
dprintk("nfsd: GETATTR(3) %s\n",
38
SVCFH_fmt(&argp->fh));
39
@@ -67,8 +68,9 @@ nfsd3_proc_getattr(struct svc_rqst *rqst
41
RETURN_STATUS(nfserr);
43
- err = vfs_getattr(resp->fh.fh_export->ex_mnt,
44
- resp->fh.fh_dentry, &resp->stat);
45
+ path.mnt = resp->fh.fh_export->ex_mnt;
46
+ path.dentry = resp->fh.fh_dentry;
47
+ err = vfs_getattr(&path, &resp->stat);
48
nfserr = nfserrno(err);
50
RETURN_STATUS(nfserr);
51
Index: linux-2.6/fs/nfsd/nfs3xdr.c
52
===================================================================
53
--- linux-2.6.orig/fs/nfsd/nfs3xdr.c
54
+++ linux-2.6/fs/nfsd/nfs3xdr.c
55
@@ -223,12 +223,15 @@ encode_saved_post_attr(struct svc_rqst *
57
encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
59
- struct dentry *dentry = fhp->fh_dentry;
60
- if (dentry && dentry->d_inode != NULL) {
63
+ path.dentry = fhp->fh_dentry;
64
+ if (path.dentry && path.dentry->d_inode != NULL) {
68
- err = vfs_getattr(fhp->fh_export->ex_mnt, dentry, &stat);
69
+ path.mnt = fhp->fh_export->ex_mnt;
70
+ err = vfs_getattr(&path, &stat);
72
*p++ = xdr_one; /* attributes follow */
73
return encode_fattr3(rqstp, p, fhp, &stat);
74
Index: linux-2.6/fs/nfsd/nfs4xdr.c
75
===================================================================
76
--- linux-2.6.orig/fs/nfsd/nfs4xdr.c
77
+++ linux-2.6/fs/nfsd/nfs4xdr.c
78
@@ -1442,6 +1442,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
81
struct nfs4_acl *acl = NULL;
84
BUG_ON(bmval1 & NFSD_WRITEONLY_ATTRS_WORD1);
85
BUG_ON(bmval0 & ~NFSD_SUPPORTED_ATTRS_WORD0);
86
@@ -1453,7 +1454,9 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
90
- err = vfs_getattr(exp->ex_mnt, dentry, &stat);
91
+ path.mnt = exp->ex_mnt;
92
+ path.dentry = dentry;
93
+ err = vfs_getattr(&path, &stat);
96
if ((bmval0 & (FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL)) ||
97
Index: linux-2.6/fs/nfsd/nfsproc.c
98
===================================================================
99
--- linux-2.6.orig/fs/nfsd/nfsproc.c
100
+++ linux-2.6/fs/nfsd/nfsproc.c
101
@@ -39,18 +39,25 @@ nfsd_proc_null(struct svc_rqst *rqstp, v
103
nfsd_return_attrs(__be32 err, struct nfsd_attrstat *resp)
105
- if (err) return err;
106
- return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt,
107
- resp->fh.fh_dentry,
113
+ path.mnt = resp->fh.fh_export->ex_mnt;
114
+ path.dentry = resp->fh.fh_dentry;
115
+ return nfserrno(vfs_getattr(&path, &resp->stat));
119
nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp)
121
- if (err) return err;
122
- return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt,
123
- resp->fh.fh_dentry,
129
+ path.mnt = resp->fh.fh_export->ex_mnt;
130
+ path.dentry = resp->fh.fh_dentry;
131
+ return nfserrno(vfs_getattr(&path, &resp->stat));
134
* Get a file's attributes
135
@@ -136,6 +143,7 @@ static __be32
136
nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp,
137
struct nfsd_readres *resp)
142
dprintk("nfsd: READ %s %d bytes at %d\n",
143
@@ -162,10 +170,11 @@ nfsd_proc_read(struct svc_rqst *rqstp, s
144
rqstp->rq_vec, argp->vlen,
147
- if (nfserr) return nfserr;
148
- return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt,
149
- resp->fh.fh_dentry,
153
+ path.mnt = resp->fh.fh_export->ex_mnt;
154
+ path.dentry = resp->fh.fh_dentry;
155
+ return nfserrno(vfs_getattr(&path, &resp->stat));
159
Index: linux-2.6/fs/nfsd/nfsxdr.c
160
===================================================================
161
--- linux-2.6.orig/fs/nfsd/nfsxdr.c
162
+++ linux-2.6/fs/nfsd/nfsxdr.c
163
@@ -193,7 +193,11 @@ encode_fattr(struct svc_rqst *rqstp, __b
164
__be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
167
- vfs_getattr(fhp->fh_export->ex_mnt, fhp->fh_dentry, &stat);
170
+ path.mnt = fhp->fh_export->ex_mnt;
171
+ path.dentry = fhp->fh_dentry;
172
+ vfs_getattr(&path, &stat);
173
return encode_fattr(rqstp, p, fhp, &stat);
176
Index: linux-2.6/fs/stat.c
177
===================================================================
178
--- linux-2.6.orig/fs/stat.c
179
+++ linux-2.6/fs/stat.c
180
@@ -38,17 +38,17 @@ void generic_fillattr(struct inode *inod
182
EXPORT_SYMBOL(generic_fillattr);
184
-int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
185
+int vfs_getattr(struct path *path, struct kstat *stat)
187
- struct inode *inode = dentry->d_inode;
188
+ struct inode *inode = path->dentry->d_inode;
191
- retval = security_inode_getattr(mnt, dentry);
192
+ retval = security_inode_getattr(path->mnt, path->dentry);
196
if (inode->i_op->getattr)
197
- return inode->i_op->getattr(mnt, dentry, stat);
198
+ return inode->i_op->getattr(path->mnt, path->dentry, stat);
200
generic_fillattr(inode, stat);
202
@@ -63,7 +63,7 @@ int vfs_stat_fd(int dfd, char __user *na
204
error = __user_walk_fd(dfd, name, LOOKUP_FOLLOW, &nd);
206
- error = vfs_getattr(nd.path.mnt, nd.path.dentry, stat);
207
+ error = vfs_getattr(&nd.path, stat);
211
@@ -83,7 +83,7 @@ int vfs_lstat_fd(int dfd, char __user *n
213
error = __user_walk_fd(dfd, name, 0, &nd);
215
- error = vfs_getattr(nd.path.mnt, nd.path.dentry, stat);
216
+ error = vfs_getattr(&nd.path, stat);
220
@@ -102,7 +102,7 @@ int vfs_fstat(unsigned int fd, struct ks
224
- error = vfs_getattr(f->f_path.mnt, f->f_path.dentry, stat);
225
+ error = vfs_getattr(&f->f_path, stat);
229
Index: linux-2.6/include/linux/fs.h
230
===================================================================
231
--- linux-2.6.orig/include/linux/fs.h
232
+++ linux-2.6/include/linux/fs.h
233
@@ -1825,7 +1825,7 @@ extern int page_symlink(struct inode *in
234
extern struct inode_operations page_symlink_inode_operations;
235
extern int generic_readlink(struct dentry *, char __user *, int);
236
extern void generic_fillattr(struct inode *, struct kstat *);
237
-extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
238
+extern int vfs_getattr(struct path *, struct kstat *);
239
void inode_add_bytes(struct inode *inode, loff_t bytes);
240
void inode_sub_bytes(struct inode *inode, loff_t bytes);
241
loff_t inode_get_bytes(struct inode *inode);