diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2014-10-30 12:37:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-10-31 17:48:54 -0400 |
commit | ac7576f4b1da8c9c6bc1ae026c2b9e86ae617ba5 (patch) | |
tree | d1bc42645ba37d31ce4cd2208f8e4ab14d47467c /fs | |
parent | 9f2f7d4c8dfcf4617af5de6ea381b91deac3db48 (diff) |
vfs: make first argument of dir_context.actor typed
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/afs/dir.c | 9 | ||||
-rw-r--r-- | fs/compat.c | 21 | ||||
-rw-r--r-- | fs/ecryptfs/file.c | 6 | ||||
-rw-r--r-- | fs/exportfs/expfs.c | 5 | ||||
-rw-r--r-- | fs/fat/dir.c | 5 | ||||
-rw-r--r-- | fs/gfs2/export.c | 8 | ||||
-rw-r--r-- | fs/hppfs/hppfs.c | 5 | ||||
-rw-r--r-- | fs/nfsd/nfs4recover.c | 5 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 12 | ||||
-rw-r--r-- | fs/nfsd/vfs.h | 4 | ||||
-rw-r--r-- | fs/ocfs2/dir.c | 8 | ||||
-rw-r--r-- | fs/ocfs2/journal.c | 8 | ||||
-rw-r--r-- | fs/overlayfs/readdir.c | 8 | ||||
-rw-r--r-- | fs/readdir.c | 21 | ||||
-rw-r--r-- | fs/reiserfs/xattr.c | 15 |
15 files changed, 83 insertions, 57 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c index a1645b88fe8a..d452f3de5434 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c | |||
@@ -26,7 +26,7 @@ static int afs_readdir(struct file *file, struct dir_context *ctx); | |||
26 | static int afs_d_revalidate(struct dentry *dentry, unsigned int flags); | 26 | static int afs_d_revalidate(struct dentry *dentry, unsigned int flags); |
27 | static int afs_d_delete(const struct dentry *dentry); | 27 | static int afs_d_delete(const struct dentry *dentry); |
28 | static void afs_d_release(struct dentry *dentry); | 28 | static void afs_d_release(struct dentry *dentry); |
29 | static int afs_lookup_filldir(void *_cookie, const char *name, int nlen, | 29 | static int afs_lookup_filldir(struct dir_context *ctx, const char *name, int nlen, |
30 | loff_t fpos, u64 ino, unsigned dtype); | 30 | loff_t fpos, u64 ino, unsigned dtype); |
31 | static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, | 31 | static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, |
32 | bool excl); | 32 | bool excl); |
@@ -391,10 +391,11 @@ static int afs_readdir(struct file *file, struct dir_context *ctx) | |||
391 | * - if afs_dir_iterate_block() spots this function, it'll pass the FID | 391 | * - if afs_dir_iterate_block() spots this function, it'll pass the FID |
392 | * uniquifier through dtype | 392 | * uniquifier through dtype |
393 | */ | 393 | */ |
394 | static int afs_lookup_filldir(void *_cookie, const char *name, int nlen, | 394 | static int afs_lookup_filldir(struct dir_context *ctx, const char *name, |
395 | loff_t fpos, u64 ino, unsigned dtype) | 395 | int nlen, loff_t fpos, u64 ino, unsigned dtype) |
396 | { | 396 | { |
397 | struct afs_lookup_cookie *cookie = _cookie; | 397 | struct afs_lookup_cookie *cookie = |
398 | container_of(ctx, struct afs_lookup_cookie, ctx); | ||
398 | 399 | ||
399 | _enter("{%s,%u},%s,%u,,%llu,%u", | 400 | _enter("{%s,%u},%s,%u,,%llu,%u", |
400 | cookie->name.name, cookie->name.len, name, nlen, | 401 | cookie->name.name, cookie->name.len, name, nlen, |
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; |
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index f5bce9096555..80154ec4f8c2 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
@@ -75,11 +75,11 @@ struct ecryptfs_getdents_callback { | |||
75 | 75 | ||
76 | /* Inspired by generic filldir in fs/readdir.c */ | 76 | /* Inspired by generic filldir in fs/readdir.c */ |
77 | static int | 77 | static int |
78 | ecryptfs_filldir(void *dirent, const char *lower_name, int lower_namelen, | 78 | ecryptfs_filldir(struct dir_context *ctx, const char *lower_name, |
79 | loff_t offset, u64 ino, unsigned int d_type) | 79 | int lower_namelen, loff_t offset, u64 ino, unsigned int d_type) |
80 | { | 80 | { |
81 | struct ecryptfs_getdents_callback *buf = | 81 | struct ecryptfs_getdents_callback *buf = |
82 | (struct ecryptfs_getdents_callback *)dirent; | 82 | container_of(ctx, struct ecryptfs_getdents_callback, ctx); |
83 | size_t name_size; | 83 | size_t name_size; |
84 | char *name; | 84 | char *name; |
85 | int rc; | 85 | int rc; |
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index b01fbfb51f43..a2b350ddd402 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c | |||
@@ -241,10 +241,11 @@ struct getdents_callback { | |||
241 | * A rather strange filldir function to capture | 241 | * A rather strange filldir function to capture |
242 | * the name matching the specified inode number. | 242 | * the name matching the specified inode number. |
243 | */ | 243 | */ |
244 | static int filldir_one(void * __buf, const char * name, int len, | 244 | static int filldir_one(struct dir_context *ctx, const char *name, int len, |
245 | loff_t pos, u64 ino, unsigned int d_type) | 245 | loff_t pos, u64 ino, unsigned int d_type) |
246 | { | 246 | { |
247 | struct getdents_callback *buf = __buf; | 247 | struct getdents_callback *buf = |
248 | container_of(ctx, struct getdents_callback, ctx); | ||
248 | int result = 0; | 249 | int result = 0; |
249 | 250 | ||
250 | buf->sequence++; | 251 | buf->sequence++; |
diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 3963ede84eb0..c5d6bb939d19 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c | |||
@@ -702,10 +702,11 @@ static int fat_readdir(struct file *file, struct dir_context *ctx) | |||
702 | } | 702 | } |
703 | 703 | ||
704 | #define FAT_IOCTL_FILLDIR_FUNC(func, dirent_type) \ | 704 | #define FAT_IOCTL_FILLDIR_FUNC(func, dirent_type) \ |
705 | static int func(void *__buf, const char *name, int name_len, \ | 705 | static int func(struct dir_context *ctx, const char *name, int name_len, \ |
706 | loff_t offset, u64 ino, unsigned int d_type) \ | 706 | loff_t offset, u64 ino, unsigned int d_type) \ |
707 | { \ | 707 | { \ |
708 | struct fat_ioctl_filldir_callback *buf = __buf; \ | 708 | struct fat_ioctl_filldir_callback *buf = \ |
709 | container_of(ctx, struct fat_ioctl_filldir_callback, ctx); \ | ||
709 | struct dirent_type __user *d1 = buf->dirent; \ | 710 | struct dirent_type __user *d1 = buf->dirent; \ |
710 | struct dirent_type __user *d2 = d1 + 1; \ | 711 | struct dirent_type __user *d2 = d1 + 1; \ |
711 | \ | 712 | \ |
diff --git a/fs/gfs2/export.c b/fs/gfs2/export.c index 8b9b3775e2e7..c41d255b6a7b 100644 --- a/fs/gfs2/export.c +++ b/fs/gfs2/export.c | |||
@@ -69,10 +69,12 @@ struct get_name_filldir { | |||
69 | char *name; | 69 | char *name; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | static int get_name_filldir(void *opaque, const char *name, int length, | 72 | static int get_name_filldir(struct dir_context *ctx, const char *name, |
73 | loff_t offset, u64 inum, unsigned int type) | 73 | int length, loff_t offset, u64 inum, |
74 | unsigned int type) | ||
74 | { | 75 | { |
75 | struct get_name_filldir *gnfd = opaque; | 76 | struct get_name_filldir *gnfd = |
77 | container_of(ctx, struct get_name_filldir, ctx); | ||
76 | 78 | ||
77 | if (inum != gnfd->inum.no_addr) | 79 | if (inum != gnfd->inum.no_addr) |
78 | return 0; | 80 | return 0; |
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c index 4338ff32959d..5f2755117ce7 100644 --- a/fs/hppfs/hppfs.c +++ b/fs/hppfs/hppfs.c | |||
@@ -548,10 +548,11 @@ struct hppfs_dirent { | |||
548 | struct dentry *dentry; | 548 | struct dentry *dentry; |
549 | }; | 549 | }; |
550 | 550 | ||
551 | static int hppfs_filldir(void *d, const char *name, int size, | 551 | static int hppfs_filldir(struct dir_context *ctx, const char *name, int size, |
552 | loff_t offset, u64 inode, unsigned int type) | 552 | loff_t offset, u64 inode, unsigned int type) |
553 | { | 553 | { |
554 | struct hppfs_dirent *dirent = d; | 554 | struct hppfs_dirent *dirent = |
555 | container_of(ctx, struct hppfs_dirent, ctx); | ||
555 | 556 | ||
556 | if (file_removed(dirent->dentry, name)) | 557 | if (file_removed(dirent->dentry, name)) |
557 | return 0; | 558 | return 0; |
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index a25490ae6c62..0e71a0dd58ca 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c | |||
@@ -245,10 +245,11 @@ struct nfs4_dir_ctx { | |||
245 | }; | 245 | }; |
246 | 246 | ||
247 | static int | 247 | static int |
248 | nfsd4_build_namelist(void *arg, const char *name, int namlen, | 248 | nfsd4_build_namelist(struct dir_context *__ctx, const char *name, int namlen, |
249 | loff_t offset, u64 ino, unsigned int d_type) | 249 | loff_t offset, u64 ino, unsigned int d_type) |
250 | { | 250 | { |
251 | struct nfs4_dir_ctx *ctx = arg; | 251 | struct nfs4_dir_ctx *ctx = |
252 | container_of(__ctx, struct nfs4_dir_ctx, ctx); | ||
252 | struct name_list *entry; | 253 | struct name_list *entry; |
253 | 254 | ||
254 | if (namlen != HEXDIR_LEN - 1) | 255 | if (namlen != HEXDIR_LEN - 1) |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 989129e2d6ea..161d2d51b6f2 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1819,10 +1819,12 @@ struct readdir_data { | |||
1819 | int full; | 1819 | int full; |
1820 | }; | 1820 | }; |
1821 | 1821 | ||
1822 | static int nfsd_buffered_filldir(void *__buf, const char *name, int namlen, | 1822 | static int nfsd_buffered_filldir(struct dir_context *ctx, const char *name, |
1823 | loff_t offset, u64 ino, unsigned int d_type) | 1823 | int namlen, loff_t offset, u64 ino, |
1824 | unsigned int d_type) | ||
1824 | { | 1825 | { |
1825 | struct readdir_data *buf = __buf; | 1826 | struct readdir_data *buf = |
1827 | container_of(ctx, struct readdir_data, ctx); | ||
1826 | struct buffered_dirent *de = (void *)(buf->dirent + buf->used); | 1828 | struct buffered_dirent *de = (void *)(buf->dirent + buf->used); |
1827 | unsigned int reclen; | 1829 | unsigned int reclen; |
1828 | 1830 | ||
@@ -1842,7 +1844,7 @@ static int nfsd_buffered_filldir(void *__buf, const char *name, int namlen, | |||
1842 | return 0; | 1844 | return 0; |
1843 | } | 1845 | } |
1844 | 1846 | ||
1845 | static __be32 nfsd_buffered_readdir(struct file *file, filldir_t func, | 1847 | static __be32 nfsd_buffered_readdir(struct file *file, nfsd_filldir_t func, |
1846 | struct readdir_cd *cdp, loff_t *offsetp) | 1848 | struct readdir_cd *cdp, loff_t *offsetp) |
1847 | { | 1849 | { |
1848 | struct buffered_dirent *de; | 1850 | struct buffered_dirent *de; |
@@ -1926,7 +1928,7 @@ static __be32 nfsd_buffered_readdir(struct file *file, filldir_t func, | |||
1926 | */ | 1928 | */ |
1927 | __be32 | 1929 | __be32 |
1928 | nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp, | 1930 | nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp, |
1929 | struct readdir_cd *cdp, filldir_t func) | 1931 | struct readdir_cd *cdp, nfsd_filldir_t func) |
1930 | { | 1932 | { |
1931 | __be32 err; | 1933 | __be32 err; |
1932 | struct file *file; | 1934 | struct file *file; |
diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h index c2ff3f14e5f6..b1796d6ee538 100644 --- a/fs/nfsd/vfs.h +++ b/fs/nfsd/vfs.h | |||
@@ -36,7 +36,7 @@ | |||
36 | /* | 36 | /* |
37 | * Callback function for readdir | 37 | * Callback function for readdir |
38 | */ | 38 | */ |
39 | typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int); | 39 | typedef int (*nfsd_filldir_t)(void *, const char *, int, loff_t, u64, unsigned); |
40 | 40 | ||
41 | /* nfsd/vfs.c */ | 41 | /* nfsd/vfs.c */ |
42 | int nfsd_racache_init(int); | 42 | int nfsd_racache_init(int); |
@@ -95,7 +95,7 @@ __be32 nfsd_rename(struct svc_rqst *, | |||
95 | __be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type, | 95 | __be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type, |
96 | char *name, int len); | 96 | char *name, int len); |
97 | __be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *, | 97 | __be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *, |
98 | loff_t *, struct readdir_cd *, filldir_t); | 98 | loff_t *, struct readdir_cd *, nfsd_filldir_t); |
99 | __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, | 99 | __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, |
100 | struct kstatfs *, int access); | 100 | struct kstatfs *, int access); |
101 | 101 | ||
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 0717662b4aef..c43d9b4a1ec0 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -2073,10 +2073,12 @@ struct ocfs2_empty_dir_priv { | |||
2073 | unsigned seen_other; | 2073 | unsigned seen_other; |
2074 | unsigned dx_dir; | 2074 | unsigned dx_dir; |
2075 | }; | 2075 | }; |
2076 | static int ocfs2_empty_dir_filldir(void *priv, const char *name, int name_len, | 2076 | static int ocfs2_empty_dir_filldir(struct dir_context *ctx, const char *name, |
2077 | loff_t pos, u64 ino, unsigned type) | 2077 | int name_len, loff_t pos, u64 ino, |
2078 | unsigned type) | ||
2078 | { | 2079 | { |
2079 | struct ocfs2_empty_dir_priv *p = priv; | 2080 | struct ocfs2_empty_dir_priv *p = |
2081 | container_of(ctx, struct ocfs2_empty_dir_priv, ctx); | ||
2080 | 2082 | ||
2081 | /* | 2083 | /* |
2082 | * Check the positions of "." and ".." records to be sure | 2084 | * Check the positions of "." and ".." records to be sure |
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 4b0c68849b36..4f502382180f 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -1982,10 +1982,12 @@ struct ocfs2_orphan_filldir_priv { | |||
1982 | struct ocfs2_super *osb; | 1982 | struct ocfs2_super *osb; |
1983 | }; | 1983 | }; |
1984 | 1984 | ||
1985 | static int ocfs2_orphan_filldir(void *priv, const char *name, int name_len, | 1985 | static int ocfs2_orphan_filldir(struct dir_context *ctx, const char *name, |
1986 | loff_t pos, u64 ino, unsigned type) | 1986 | int name_len, loff_t pos, u64 ino, |
1987 | unsigned type) | ||
1987 | { | 1988 | { |
1988 | struct ocfs2_orphan_filldir_priv *p = priv; | 1989 | struct ocfs2_orphan_filldir_priv *p = |
1990 | container_of(ctx, struct ocfs2_orphan_filldir_priv, ctx); | ||
1989 | struct inode *iter; | 1991 | struct inode *iter; |
1990 | 1992 | ||
1991 | if (name_len == 1 && !strncmp(".", name, 1)) | 1993 | if (name_len == 1 && !strncmp(".", name, 1)) |
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index 4e9d7c1fea52..301f64aa8a45 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c | |||
@@ -180,10 +180,12 @@ static void ovl_cache_put(struct ovl_dir_file *od, struct dentry *dentry) | |||
180 | } | 180 | } |
181 | } | 181 | } |
182 | 182 | ||
183 | static int ovl_fill_merge(void *buf, const char *name, int namelen, | 183 | static int ovl_fill_merge(struct dir_context *ctx, const char *name, |
184 | loff_t offset, u64 ino, unsigned int d_type) | 184 | int namelen, loff_t offset, u64 ino, |
185 | unsigned int d_type) | ||
185 | { | 186 | { |
186 | struct ovl_readdir_data *rdd = buf; | 187 | struct ovl_readdir_data *rdd = |
188 | container_of(ctx, struct ovl_readdir_data, ctx); | ||
187 | 189 | ||
188 | rdd->count++; | 190 | rdd->count++; |
189 | if (!rdd->is_merge) | 191 | if (!rdd->is_merge) |
diff --git a/fs/readdir.c b/fs/readdir.c index 33fd92208cb7..ced679179cac 100644 --- a/fs/readdir.c +++ b/fs/readdir.c | |||
@@ -74,10 +74,11 @@ struct readdir_callback { | |||
74 | int result; | 74 | int result; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset, | 77 | static int fillonedir(struct dir_context *ctx, const char *name, int namlen, |
78 | u64 ino, unsigned int d_type) | 78 | loff_t offset, u64 ino, unsigned int d_type) |
79 | { | 79 | { |
80 | struct readdir_callback *buf = (struct readdir_callback *) __buf; | 80 | struct readdir_callback *buf = |
81 | container_of(ctx, struct readdir_callback, ctx); | ||
81 | struct old_linux_dirent __user * dirent; | 82 | struct old_linux_dirent __user * dirent; |
82 | unsigned long d_ino; | 83 | unsigned long d_ino; |
83 | 84 | ||
@@ -148,11 +149,12 @@ struct getdents_callback { | |||
148 | int error; | 149 | int error; |
149 | }; | 150 | }; |
150 | 151 | ||
151 | static int filldir(void * __buf, const char * name, int namlen, loff_t offset, | 152 | static int filldir(struct dir_context *ctx, const char *name, int namlen, |
152 | u64 ino, unsigned int d_type) | 153 | loff_t offset, u64 ino, unsigned int d_type) |
153 | { | 154 | { |
154 | struct linux_dirent __user * dirent; | 155 | struct linux_dirent __user * dirent; |
155 | struct getdents_callback * buf = (struct getdents_callback *) __buf; | 156 | struct getdents_callback *buf = |
157 | container_of(ctx, struct getdents_callback, ctx); | ||
156 | unsigned long d_ino; | 158 | unsigned long d_ino; |
157 | int reclen = ALIGN(offsetof(struct linux_dirent, d_name) + namlen + 2, | 159 | int reclen = ALIGN(offsetof(struct linux_dirent, d_name) + namlen + 2, |
158 | sizeof(long)); | 160 | sizeof(long)); |
@@ -232,11 +234,12 @@ struct getdents_callback64 { | |||
232 | int error; | 234 | int error; |
233 | }; | 235 | }; |
234 | 236 | ||
235 | static int filldir64(void * __buf, const char * name, int namlen, loff_t offset, | 237 | static int filldir64(struct dir_context *ctx, const char *name, int namlen, |
236 | u64 ino, unsigned int d_type) | 238 | loff_t offset, u64 ino, unsigned int d_type) |
237 | { | 239 | { |
238 | struct linux_dirent64 __user *dirent; | 240 | struct linux_dirent64 __user *dirent; |
239 | struct getdents_callback64 * buf = (struct getdents_callback64 *) __buf; | 241 | struct getdents_callback64 *buf = |
242 | container_of(ctx, struct getdents_callback64, ctx); | ||
240 | int reclen = ALIGN(offsetof(struct linux_dirent64, d_name) + namlen + 1, | 243 | int reclen = ALIGN(offsetof(struct linux_dirent64, d_name) + namlen + 1, |
241 | sizeof(u64)); | 244 | sizeof(u64)); |
242 | 245 | ||
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 7c36898af402..628248ce2f8b 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -188,10 +188,11 @@ struct reiserfs_dentry_buf { | |||
188 | }; | 188 | }; |
189 | 189 | ||
190 | static int | 190 | static int |
191 | fill_with_dentries(void *buf, const char *name, int namelen, loff_t offset, | 191 | fill_with_dentries(struct dir_context *ctx, const char *name, int namelen, |
192 | u64 ino, unsigned int d_type) | 192 | loff_t offset, u64 ino, unsigned int d_type) |
193 | { | 193 | { |
194 | struct reiserfs_dentry_buf *dbuf = buf; | 194 | struct reiserfs_dentry_buf *dbuf = |
195 | container_of(ctx, struct reiserfs_dentry_buf, ctx); | ||
195 | struct dentry *dentry; | 196 | struct dentry *dentry; |
196 | 197 | ||
197 | WARN_ON_ONCE(!mutex_is_locked(&dbuf->xadir->d_inode->i_mutex)); | 198 | WARN_ON_ONCE(!mutex_is_locked(&dbuf->xadir->d_inode->i_mutex)); |
@@ -824,10 +825,12 @@ struct listxattr_buf { | |||
824 | struct dentry *dentry; | 825 | struct dentry *dentry; |
825 | }; | 826 | }; |
826 | 827 | ||
827 | static int listxattr_filler(void *buf, const char *name, int namelen, | 828 | static int listxattr_filler(struct dir_context *ctx, const char *name, |
828 | loff_t offset, u64 ino, unsigned int d_type) | 829 | int namelen, loff_t offset, u64 ino, |
830 | unsigned int d_type) | ||
829 | { | 831 | { |
830 | struct listxattr_buf *b = (struct listxattr_buf *)buf; | 832 | struct listxattr_buf *b = |
833 | container_of(ctx, struct listxattr_buf, ctx); | ||
831 | size_t size; | 834 | size_t size; |
832 | 835 | ||
833 | if (name[0] != '.' || | 836 | if (name[0] != '.' || |