diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-05-22 22:22:04 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:57:05 -0400 |
commit | ac6614b76478e68173ccf7ad4e9e98035cc9c21d (patch) | |
tree | ed2c996b6e64e44c5a752dfafd650bfa1eb7f035 /fs/nfsd | |
parent | 2233f31aade393641f0eaed43a71110e629bb900 (diff) |
[readdir] constify ->actor
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4recover.c | 7 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 2fa2e2eb190b..105a3b080d12 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c | |||
@@ -268,7 +268,10 @@ nfsd4_list_rec_dir(recdir_func *f, struct nfsd_net *nn) | |||
268 | { | 268 | { |
269 | const struct cred *original_cred; | 269 | const struct cred *original_cred; |
270 | struct dentry *dir = nn->rec_file->f_path.dentry; | 270 | struct dentry *dir = nn->rec_file->f_path.dentry; |
271 | struct nfs4_dir_ctx ctx; | 271 | struct nfs4_dir_ctx ctx = { |
272 | .ctx.actor = nfsd4_build_namelist, | ||
273 | .names = LIST_HEAD_INIT(ctx.names) | ||
274 | }; | ||
272 | int status; | 275 | int status; |
273 | 276 | ||
274 | status = nfs4_save_creds(&original_cred); | 277 | status = nfs4_save_creds(&original_cred); |
@@ -281,8 +284,6 @@ nfsd4_list_rec_dir(recdir_func *f, struct nfsd_net *nn) | |||
281 | return status; | 284 | return status; |
282 | } | 285 | } |
283 | 286 | ||
284 | INIT_LIST_HEAD(&ctx.names); | ||
285 | ctx.ctx.actor = nfsd4_build_namelist; | ||
286 | status = iterate_dir(nn->rec_file, &ctx.ctx); | 287 | status = iterate_dir(nn->rec_file, &ctx.ctx); |
287 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); | 288 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); |
288 | while (!list_empty(&ctx.names)) { | 289 | while (!list_empty(&ctx.names)) { |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index f939ba9bf8e8..a6bc8a7423db 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1944,14 +1944,15 @@ static int nfsd_buffered_filldir(void *__buf, const char *name, int namlen, | |||
1944 | static __be32 nfsd_buffered_readdir(struct file *file, filldir_t func, | 1944 | static __be32 nfsd_buffered_readdir(struct file *file, filldir_t func, |
1945 | struct readdir_cd *cdp, loff_t *offsetp) | 1945 | struct readdir_cd *cdp, loff_t *offsetp) |
1946 | { | 1946 | { |
1947 | struct readdir_data buf; | ||
1948 | struct buffered_dirent *de; | 1947 | struct buffered_dirent *de; |
1949 | int host_err; | 1948 | int host_err; |
1950 | int size; | 1949 | int size; |
1951 | loff_t offset; | 1950 | loff_t offset; |
1951 | struct readdir_data buf = { | ||
1952 | .ctx.actor = nfsd_buffered_filldir, | ||
1953 | .dirent = (void *)__get_free_page(GFP_KERNEL) | ||
1954 | }; | ||
1952 | 1955 | ||
1953 | buf.ctx.actor = nfsd_buffered_filldir; | ||
1954 | buf.dirent = (void *)__get_free_page(GFP_KERNEL); | ||
1955 | if (!buf.dirent) | 1956 | if (!buf.dirent) |
1956 | return nfserrno(-ENOMEM); | 1957 | return nfserrno(-ENOMEM); |
1957 | 1958 | ||