summaryrefslogtreecommitdiff
path: root/fs/readdir.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-05-23 06:22:04 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 12:57:05 +0400
commitac6614b76478e68173ccf7ad4e9e98035cc9c21d (patch)
treeed2c996b6e64e44c5a752dfafd650bfa1eb7f035 /fs/readdir.c
parent2233f31aade393641f0eaed43a71110e629bb900 (diff)
downloadlinux-ac6614b76478e68173ccf7ad4e9e98035cc9c21d.tar.xz
[readdir] constify ->actor
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/readdir.c')
-rw-r--r--fs/readdir.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/fs/readdir.c b/fs/readdir.c
index a6245c9fd0e6..93d71e574310 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -109,15 +109,14 @@ SYSCALL_DEFINE3(old_readdir, unsigned int, fd,
{
int error;
struct fd f = fdget(fd);
- struct readdir_callback buf;
+ struct readdir_callback buf = {
+ .ctx.actor = fillonedir,
+ .dirent = dirent
+ };
if (!f.file)
return -EBADF;
- buf.ctx.actor = fillonedir;
- buf.result = 0;
- buf.dirent = dirent;
-
error = iterate_dir(f.file, &buf.ctx);
if (buf.result)
error = buf.result;
@@ -195,7 +194,11 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd,
{
struct fd f;
struct linux_dirent __user * lastdirent;
- struct getdents_callback buf;
+ struct getdents_callback buf = {
+ .ctx.actor = filldir,
+ .count = count,
+ .current_dir = dirent
+ };
int error;
if (!access_ok(VERIFY_WRITE, dirent, count))
@@ -205,12 +208,6 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd,
if (!f.file)
return -EBADF;
- buf.current_dir = dirent;
- buf.previous = NULL;
- buf.count = count;
- buf.error = 0;
- buf.ctx.actor = filldir;
-
error = iterate_dir(f.file, &buf.ctx);
if (error >= 0)
error = buf.error;
@@ -277,7 +274,11 @@ SYSCALL_DEFINE3(getdents64, unsigned int, fd,
{
struct fd f;
struct linux_dirent64 __user * lastdirent;
- struct getdents_callback64 buf;
+ struct getdents_callback64 buf = {
+ .ctx.actor = filldir64,
+ .count = count,
+ .current_dir = dirent
+ };
int error;
if (!access_ok(VERIFY_WRITE, dirent, count))
@@ -287,12 +288,6 @@ SYSCALL_DEFINE3(getdents64, unsigned int, fd,
if (!f.file)
return -EBADF;
- buf.current_dir = dirent;
- buf.previous = NULL;
- buf.count = count;
- buf.error = 0;
- buf.ctx.actor = filldir64;
-
error = iterate_dir(f.file, &buf.ctx);
if (error >= 0)
error = buf.error;