diff options
Diffstat (limited to 'fs/compat.c')
-rw-r--r-- | fs/compat.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/compat.c b/fs/compat.c index b13df99f3534..6fd272d455e4 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -847,10 +847,12 @@ struct compat_readdir_callback { | |||
847 | int result; | 847 | int result; |
848 | }; | 848 | }; |
849 | 849 | ||
850 | static int compat_fillonedir(void *__buf, const char *name, int namlen, | 850 | static int compat_fillonedir(struct dir_context *ctx, const char *name, |
851 | loff_t offset, u64 ino, unsigned int d_type) | 851 | int namlen, loff_t offset, u64 ino, |
852 | unsigned int d_type) | ||
852 | { | 853 | { |
853 | struct compat_readdir_callback *buf = __buf; | 854 | struct compat_readdir_callback *buf = |
855 | container_of(ctx, struct compat_readdir_callback, ctx); | ||
854 | struct compat_old_linux_dirent __user *dirent; | 856 | struct compat_old_linux_dirent __user *dirent; |
855 | compat_ulong_t d_ino; | 857 | compat_ulong_t d_ino; |
856 | 858 | ||
@@ -915,11 +917,12 @@ struct compat_getdents_callback { | |||
915 | int error; | 917 | int error; |
916 | }; | 918 | }; |
917 | 919 | ||
918 | static int compat_filldir(void *__buf, const char *name, int namlen, | 920 | static int compat_filldir(struct dir_context *ctx, const char *name, int namlen, |
919 | loff_t offset, u64 ino, unsigned int d_type) | 921 | loff_t offset, u64 ino, unsigned int d_type) |
920 | { | 922 | { |
921 | struct compat_linux_dirent __user * dirent; | 923 | struct compat_linux_dirent __user * dirent; |
922 | struct compat_getdents_callback *buf = __buf; | 924 | struct compat_getdents_callback *buf = |
925 | container_of(ctx, struct compat_getdents_callback, ctx); | ||
923 | compat_ulong_t d_ino; | 926 | compat_ulong_t d_ino; |
924 | int reclen = ALIGN(offsetof(struct compat_linux_dirent, d_name) + | 927 | int reclen = ALIGN(offsetof(struct compat_linux_dirent, d_name) + |
925 | namlen + 2, sizeof(compat_long_t)); | 928 | namlen + 2, sizeof(compat_long_t)); |
@@ -1001,11 +1004,13 @@ struct compat_getdents_callback64 { | |||
1001 | int error; | 1004 | int error; |
1002 | }; | 1005 | }; |
1003 | 1006 | ||
1004 | static int compat_filldir64(void * __buf, const char * name, int namlen, loff_t offset, | 1007 | static int compat_filldir64(struct dir_context *ctx, const char *name, |
1005 | u64 ino, unsigned int d_type) | 1008 | int namlen, loff_t offset, u64 ino, |
1009 | unsigned int d_type) | ||
1006 | { | 1010 | { |
1007 | struct linux_dirent64 __user *dirent; | 1011 | struct linux_dirent64 __user *dirent; |
1008 | struct compat_getdents_callback64 *buf = __buf; | 1012 | struct compat_getdents_callback64 *buf = |
1013 | container_of(ctx, struct compat_getdents_callback64, ctx); | ||
1009 | int reclen = ALIGN(offsetof(struct linux_dirent64, d_name) + namlen + 1, | 1014 | int reclen = ALIGN(offsetof(struct linux_dirent64, d_name) + namlen + 1, |
1010 | sizeof(u64)); | 1015 | sizeof(u64)); |
1011 | u64 off; | 1016 | u64 off; |