diff options
Diffstat (limited to 'fs/compat.c')
-rw-r--r-- | fs/compat.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/compat.c b/fs/compat.c index fc3b55dce184..2279b59e81f2 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -832,6 +832,7 @@ struct compat_old_linux_dirent { | |||
832 | }; | 832 | }; |
833 | 833 | ||
834 | struct compat_readdir_callback { | 834 | struct compat_readdir_callback { |
835 | struct dir_context ctx; | ||
835 | struct compat_old_linux_dirent __user *dirent; | 836 | struct compat_old_linux_dirent __user *dirent; |
836 | int result; | 837 | int result; |
837 | }; | 838 | }; |
@@ -880,8 +881,9 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd, | |||
880 | 881 | ||
881 | buf.result = 0; | 882 | buf.result = 0; |
882 | buf.dirent = dirent; | 883 | buf.dirent = dirent; |
884 | buf.ctx.actor = compat_fillonedir; | ||
883 | 885 | ||
884 | error = vfs_readdir(f.file, compat_fillonedir, &buf); | 886 | error = iterate_dir(f.file, &buf.ctx); |
885 | if (buf.result) | 887 | if (buf.result) |
886 | error = buf.result; | 888 | error = buf.result; |
887 | 889 | ||
@@ -897,6 +899,7 @@ struct compat_linux_dirent { | |||
897 | }; | 899 | }; |
898 | 900 | ||
899 | struct compat_getdents_callback { | 901 | struct compat_getdents_callback { |
902 | struct dir_context ctx; | ||
900 | struct compat_linux_dirent __user *current_dir; | 903 | struct compat_linux_dirent __user *current_dir; |
901 | struct compat_linux_dirent __user *previous; | 904 | struct compat_linux_dirent __user *previous; |
902 | int count; | 905 | int count; |
@@ -965,8 +968,9 @@ asmlinkage long compat_sys_getdents(unsigned int fd, | |||
965 | buf.previous = NULL; | 968 | buf.previous = NULL; |
966 | buf.count = count; | 969 | buf.count = count; |
967 | buf.error = 0; | 970 | buf.error = 0; |
971 | buf.ctx.actor = compat_filldir; | ||
968 | 972 | ||
969 | error = vfs_readdir(f.file, compat_filldir, &buf); | 973 | error = iterate_dir(f.file, &buf.ctx); |
970 | if (error >= 0) | 974 | if (error >= 0) |
971 | error = buf.error; | 975 | error = buf.error; |
972 | lastdirent = buf.previous; | 976 | lastdirent = buf.previous; |
@@ -983,6 +987,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd, | |||
983 | #ifndef __ARCH_OMIT_COMPAT_SYS_GETDENTS64 | 987 | #ifndef __ARCH_OMIT_COMPAT_SYS_GETDENTS64 |
984 | 988 | ||
985 | struct compat_getdents_callback64 { | 989 | struct compat_getdents_callback64 { |
990 | struct dir_context ctx; | ||
986 | struct linux_dirent64 __user *current_dir; | 991 | struct linux_dirent64 __user *current_dir; |
987 | struct linux_dirent64 __user *previous; | 992 | struct linux_dirent64 __user *previous; |
988 | int count; | 993 | int count; |
@@ -1050,8 +1055,9 @@ asmlinkage long compat_sys_getdents64(unsigned int fd, | |||
1050 | buf.previous = NULL; | 1055 | buf.previous = NULL; |
1051 | buf.count = count; | 1056 | buf.count = count; |
1052 | buf.error = 0; | 1057 | buf.error = 0; |
1058 | buf.ctx.actor = compat_filldir64; | ||
1053 | 1059 | ||
1054 | error = vfs_readdir(f.file, compat_filldir64, &buf); | 1060 | error = iterate_dir(f.file, &buf.ctx); |
1055 | if (error >= 0) | 1061 | if (error >= 0) |
1056 | error = buf.error; | 1062 | error = buf.error; |
1057 | lastdirent = buf.previous; | 1063 | lastdirent = buf.previous; |