26 #include <linux/module.h>
27 #include <linux/errno.h>
30 #include <linux/stat.h>
31 #include <linux/string.h>
32 #include <linux/sched.h>
35 #include <linux/slab.h>
67 static inline int dt_type(
struct p9_wstat *mistat)
80 static void p9stat_init(
struct p9_wstat *stbuf)
96 static int v9fs_alloc_rdir_buf(
struct file *filp,
int buflen)
110 spin_lock(&filp->f_dentry->d_lock);
115 fid->
rdir = (
void *) rdir;
118 spin_unlock(&filp->f_dentry->d_lock);
148 err = v9fs_alloc_rdir_buf(filp, buflen);
159 buflen, filp->
f_pos);
161 goto unlock_and_exit;
174 goto unlock_and_exit;
178 over = filldir(dirent,
st.name,
strlen(
st.name),
185 goto unlock_and_exit;
187 rdir->
head += reclen;
188 filp->
f_pos += reclen;
205 static int v9fs_dir_readdir_dotl(
struct file *filp,
void *dirent,
221 err = v9fs_alloc_rdir_buf(filp, buflen);
235 goto unlock_and_exit;
249 goto unlock_and_exit;
258 over = filldir(dirent, curdirent.d_name,
262 oldoffset = curdirent.d_off;
266 goto unlock_and_exit;
269 filp->
f_pos = curdirent.d_off;
294 inode, filp, fid ? fid->
fid : -1);
303 .readdir = v9fs_dir_readdir,
311 .readdir = v9fs_dir_readdir_dotl,