aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-05-22 22:22:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 04:57:05 -0400
commitac6614b76478e68173ccf7ad4e9e98035cc9c21d (patch)
treeed2c996b6e64e44c5a752dfafd650bfa1eb7f035 /fs/compat.c
parent2233f31aade393641f0eaed43a71110e629bb900 (diff)
[readdir] constify ->actor
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/compat.c')
-rw-r--r--fs/compat.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/fs/compat.c b/fs/compat.c
index 69ca1e301766..6af20de2c1a3 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -874,15 +874,14 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd,
874{ 874{
875 int error; 875 int error;
876 struct fd f = fdget(fd); 876 struct fd f = fdget(fd);
877 struct compat_readdir_callback buf; 877 struct compat_readdir_callback buf = {
878 .ctx.actor = compat_fillonedir,
879 .dirent = dirent
880 };
878 881
879 if (!f.file) 882 if (!f.file)
880 return -EBADF; 883 return -EBADF;
881 884
882 buf.result = 0;
883 buf.dirent = dirent;
884 buf.ctx.actor = compat_fillonedir;
885
886 error = iterate_dir(f.file, &buf.ctx); 885 error = iterate_dir(f.file, &buf.ctx);
887 if (buf.result) 886 if (buf.result)
888 error = buf.result; 887 error = buf.result;
@@ -954,7 +953,11 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
954{ 953{
955 struct fd f; 954 struct fd f;
956 struct compat_linux_dirent __user * lastdirent; 955 struct compat_linux_dirent __user * lastdirent;
957 struct compat_getdents_callback buf; 956 struct compat_getdents_callback buf = {
957 .ctx.actor = compat_filldir,
958 .current_dir = dirent,
959 .count = count
960 };
958 int error; 961 int error;
959 962
960 if (!access_ok(VERIFY_WRITE, dirent, count)) 963 if (!access_ok(VERIFY_WRITE, dirent, count))
@@ -964,12 +967,6 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
964 if (!f.file) 967 if (!f.file)
965 return -EBADF; 968 return -EBADF;
966 969
967 buf.current_dir = dirent;
968 buf.previous = NULL;
969 buf.count = count;
970 buf.error = 0;
971 buf.ctx.actor = compat_filldir;
972
973 error = iterate_dir(f.file, &buf.ctx); 970 error = iterate_dir(f.file, &buf.ctx);
974 if (error >= 0) 971 if (error >= 0)
975 error = buf.error; 972 error = buf.error;
@@ -1041,7 +1038,11 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
1041{ 1038{
1042 struct fd f; 1039 struct fd f;
1043 struct linux_dirent64 __user * lastdirent; 1040 struct linux_dirent64 __user * lastdirent;
1044 struct compat_getdents_callback64 buf; 1041 struct compat_getdents_callback64 buf = {
1042 .ctx.actor = compat_filldir64,
1043 .current_dir = dirent,
1044 .count = count
1045 };
1045 int error; 1046 int error;
1046 1047
1047 if (!access_ok(VERIFY_WRITE, dirent, count)) 1048 if (!access_ok(VERIFY_WRITE, dirent, count))
@@ -1051,12 +1052,6 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
1051 if (!f.file) 1052 if (!f.file)
1052 return -EBADF; 1053 return -EBADF;
1053 1054
1054 buf.current_dir = dirent;
1055 buf.previous = NULL;
1056 buf.count = count;
1057 buf.error = 0;
1058 buf.ctx.actor = compat_filldir64;
1059
1060 error = iterate_dir(f.file, &buf.ctx); 1055 error = iterate_dir(f.file, &buf.ctx);
1061 if (error >= 0) 1056 if (error >= 0)
1062 error = buf.error; 1057 error = buf.error;