aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/vfs_dir.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 276aed625929..873cd31baa47 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -45,7 +45,7 @@
45 * 45 *
46 */ 46 */
47 47
48static inline int dt_type(struct p9_stat *mistat) 48static inline int dt_type(struct p9_wstat *mistat)
49{ 49{
50 unsigned long perm = mistat->mode; 50 unsigned long perm = mistat->mode;
51 int rettype = DT_REG; 51 int rettype = DT_REG;
@@ -69,7 +69,7 @@ static inline int dt_type(struct p9_stat *mistat)
69static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir) 69static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
70{ 70{
71 int over; 71 int over;
72 struct p9_stat st; 72 struct p9_wstat st;
73 int err; 73 int err;
74 struct p9_fid *fid; 74 struct p9_fid *fid;
75 int buflen; 75 int buflen;
@@ -92,20 +92,24 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
92 92
93 n = err; 93 n = err;
94 while (i < n) { 94 while (i < n) {
95 err = p9_deserialize_stat(statbuf + i, buflen-i, &st, 95 err = p9stat_read(statbuf + i, buflen-i, &st,
96 fid->clnt->dotu); 96 fid->clnt->dotu);
97 if (!err) { 97 if (err) {
98 P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err);
98 err = -EIO; 99 err = -EIO;
100 p9stat_free(&st);
99 goto free_and_exit; 101 goto free_and_exit;
100 } 102 }
101 103
102 i += err; 104 i += st.size+2;
103 fid->rdir_fpos += err; 105 fid->rdir_fpos += st.size+2;
104 106
105 over = filldir(dirent, st.name.str, st.name.len, 107 over = filldir(dirent, st.name, strlen(st.name),
106 filp->f_pos, v9fs_qid2ino(&st.qid), dt_type(&st)); 108 filp->f_pos, v9fs_qid2ino(&st.qid), dt_type(&st));
107 109
108 filp->f_pos += st.size; 110 filp->f_pos += st.size+2;
111
112 p9stat_free(&st);
109 113
110 if (over) { 114 if (over) {
111 err = 0; 115 err = 0;