aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2014-10-30 12:37:34 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-10-31 17:48:54 -0400
commitac7576f4b1da8c9c6bc1ae026c2b9e86ae617ba5 (patch)
treed1bc42645ba37d31ce4cd2208f8e4ab14d47467c
parent9f2f7d4c8dfcf4617af5de6ea381b91deac3db48 (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>
-rw-r--r--arch/alpha/kernel/osf_sys.c7
-rw-r--r--arch/parisc/hpux/fs.c7
-rw-r--r--drivers/staging/lustre/lustre/llite/llite_nfs.c8
-rw-r--r--fs/afs/dir.c9
-rw-r--r--fs/compat.c21
-rw-r--r--fs/ecryptfs/file.c6
-rw-r--r--fs/exportfs/expfs.c5
-rw-r--r--fs/fat/dir.c5
-rw-r--r--fs/gfs2/export.c8
-rw-r--r--fs/hppfs/hppfs.c5
-rw-r--r--fs/nfsd/nfs4recover.c5
-rw-r--r--fs/nfsd/vfs.c12
-rw-r--r--fs/nfsd/vfs.h4
-rw-r--r--fs/ocfs2/dir.c8
-rw-r--r--fs/ocfs2/journal.c8
-rw-r--r--fs/overlayfs/readdir.c8
-rw-r--r--fs/readdir.c21
-rw-r--r--fs/reiserfs/xattr.c15
-rw-r--r--include/linux/fs.h5
19 files changed, 100 insertions, 67 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index f9c732e18284..e51f578636a5 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -104,11 +104,12 @@ struct osf_dirent_callback {
104}; 104};
105 105
106static int 106static int
107osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, 107osf_filldir(struct dir_context *ctx, const char *name, int namlen,
108 u64 ino, unsigned int d_type) 108 loff_t offset, u64 ino, unsigned int d_type)
109{ 109{
110 struct osf_dirent __user *dirent; 110 struct osf_dirent __user *dirent;
111 struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf; 111 struct osf_dirent_callback *buf =
112 container_of(ctx, struct osf_dirent_callback, ctx);
112 unsigned int reclen = ALIGN(NAME_OFFSET + namlen + 1, sizeof(u32)); 113 unsigned int reclen = ALIGN(NAME_OFFSET + namlen + 1, sizeof(u32));
113 unsigned int d_ino; 114 unsigned int d_ino;
114 115
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c
index 2bedafea3d94..97a7bf8df348 100644
--- a/arch/parisc/hpux/fs.c
+++ b/arch/parisc/hpux/fs.c
@@ -56,11 +56,12 @@ struct getdents_callback {
56 56
57#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) 57#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
58 58
59static int filldir(void * __buf, const char * name, int namlen, loff_t offset, 59static int filldir(struct dir_context *ctx, const char *name, int namlen,
60 u64 ino, unsigned d_type) 60 loff_t offset, u64 ino, unsigned d_type)
61{ 61{
62 struct hpux_dirent __user * dirent; 62 struct hpux_dirent __user * dirent;
63 struct getdents_callback * buf = (struct getdents_callback *) __buf; 63 struct getdents_callback *buf =
64 container_of(ctx, struct getdents_callback, ctx);
64 ino_t d_ino; 65 ino_t d_ino;
65 int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, sizeof(long)); 66 int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, sizeof(long));
66 67
diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index ae3a12ab7fa1..243a7840457f 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -207,13 +207,15 @@ static int ll_encode_fh(struct inode *inode, __u32 *fh, int *plen,
207 return LUSTRE_NFS_FID; 207 return LUSTRE_NFS_FID;
208} 208}
209 209
210static int ll_nfs_get_name_filldir(void *cookie, const char *name, int namelen, 210static int ll_nfs_get_name_filldir(struct dir_context *ctx, const char *name,
211 loff_t hash, u64 ino, unsigned type) 211 int namelen, loff_t hash, u64 ino,
212 unsigned type)
212{ 213{
213 /* It is hack to access lde_fid for comparison with lgd_fid. 214 /* It is hack to access lde_fid for comparison with lgd_fid.
214 * So the input 'name' must be part of the 'lu_dirent'. */ 215 * So the input 'name' must be part of the 'lu_dirent'. */
215 struct lu_dirent *lde = container_of0(name, struct lu_dirent, lde_name); 216 struct lu_dirent *lde = container_of0(name, struct lu_dirent, lde_name);
216 struct ll_getname_data *lgd = cookie; 217 struct ll_getname_data *lgd =
218 container_of(ctx, struct ll_getname_data, ctx);
217 struct lu_fid fid; 219 struct lu_fid fid;
218 220
219 fid_le_to_cpu(&fid, &lde->lde_fid); 221 fid_le_to_cpu(&fid, &lde->lde_fid);
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);
26static int afs_d_revalidate(struct dentry *dentry, unsigned int flags); 26static int afs_d_revalidate(struct dentry *dentry, unsigned int flags);
27static int afs_d_delete(const struct dentry *dentry); 27static int afs_d_delete(const struct dentry *dentry);
28static void afs_d_release(struct dentry *dentry); 28static void afs_d_release(struct dentry *dentry);
29static int afs_lookup_filldir(void *_cookie, const char *name, int nlen, 29static 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);
31static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 31static 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 */
394static int afs_lookup_filldir(void *_cookie, const char *name, int nlen, 394static 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
850static int compat_fillonedir(void *__buf, const char *name, int namlen, 850static 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
918static int compat_filldir(void *__buf, const char *name, int namlen, 920static 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
1004static int compat_filldir64(void * __buf, const char * name, int namlen, loff_t offset, 1007static 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 */
77static int 77static int
78ecryptfs_filldir(void *dirent, const char *lower_name, int lower_namelen, 78ecryptfs_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 */
244static int filldir_one(void * __buf, const char * name, int len, 244static 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) \
705static int func(void *__buf, const char *name, int name_len, \ 705static 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
72static int get_name_filldir(void *opaque, const char *name, int length, 72static 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
551static int hppfs_filldir(void *d, const char *name, int size, 551static 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
247static int 247static int
248nfsd4_build_namelist(void *arg, const char *name, int namlen, 248nfsd4_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
1822static int nfsd_buffered_filldir(void *__buf, const char *name, int namlen, 1822static 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
1845static __be32 nfsd_buffered_readdir(struct file *file, filldir_t func, 1847static __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
1928nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp, 1930nfsd_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 */
39typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int); 39typedef int (*nfsd_filldir_t)(void *, const char *, int, loff_t, u64, unsigned);
40 40
41/* nfsd/vfs.c */ 41/* nfsd/vfs.c */
42int nfsd_racache_init(int); 42int 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};
2076static int ocfs2_empty_dir_filldir(void *priv, const char *name, int name_len, 2076static 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
1985static int ocfs2_orphan_filldir(void *priv, const char *name, int name_len, 1985static 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
183static int ovl_fill_merge(void *buf, const char *name, int namelen, 183static 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
77static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset, 77static 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
151static int filldir(void * __buf, const char * name, int namlen, loff_t offset, 152static 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
235static int filldir64(void * __buf, const char * name, int namlen, loff_t offset, 237static 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
190static int 190static int
191fill_with_dentries(void *buf, const char *name, int namelen, loff_t offset, 191fill_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
827static int listxattr_filler(void *buf, const char *name, int namelen, 828static 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] != '.' ||
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 9ab779e8a63c..00c8e4f65cb6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1467,7 +1467,10 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
1467 * This allows the kernel to read directories into kernel space or 1467 * This allows the kernel to read directories into kernel space or
1468 * to have different dirent layouts depending on the binary type. 1468 * to have different dirent layouts depending on the binary type.
1469 */ 1469 */
1470typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); 1470struct dir_context;
1471typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64,
1472 unsigned);
1473
1471struct dir_context { 1474struct dir_context {
1472 const filldir_t actor; 1475 const filldir_t actor;
1473 loff_t pos; 1476 loff_t pos;