@@ -131,8 +131,8 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
rdir->head = 0;
rdir->tail = err;
}
-
while (rdir->head < rdir->tail) {
+ p9stat_init(&st);
err = p9stat_read(rdir->buf + rdir->head,
buflen - rdir->head, &st,
fid->clnt->dotu);
@@ -208,6 +208,7 @@ void p9_client_cb(struct p9_client *c, struct p9_req_t *req);
int p9_parse_header(struct p9_fcall *, int32_t *, int8_t *, int16_t *, int);
int p9stat_read(char *, int, struct p9_wstat *, int);
void p9stat_free(struct p9_wstat *);
+void p9stat_init(struct p9_wstat *);
#endif /* NET_9P_CLIENT_H */
@@ -91,6 +91,15 @@ p9pdu_dump(int way, struct p9_fcall *pdu)
#endif
EXPORT_SYMBOL(p9pdu_dump);
+void p9stat_init(struct p9_wstat *stbuf)
+{
+ stbuf->name = NULL;
+ stbuf->uid = NULL;
+ stbuf->gid = NULL;
+ stbuf->muid = NULL;
+ stbuf->extension = NULL;
+}
+
void p9stat_free(struct p9_wstat *stbuf)
{
kfree(stbuf->name);