5 #include <linux/string.h>
6 #include <linux/errno.h>
9 #include <linux/stat.h>
11 #include <linux/slab.h>
12 #include <asm/uaccess.h>
16 static int reiserfs_readdir(
struct file *,
void *,
filldir_t);
17 static int reiserfs_dir_fsync(
struct file *filp, loff_t
start, loff_t
end,
23 .readdir = reiserfs_readdir,
24 .fsync = reiserfs_dir_fsync,
31 static int reiserfs_dir_fsync(
struct file *filp, loff_t
start, loff_t
end,
51 #define store_ih(where,what) copy_item_head (where, what)
53 static inline bool is_privroot_deh(
struct dentry *dir,
56 struct dentry *privroot = REISERFS_SB(dir->
d_sb)->priv_root;
64 struct inode *inode = dentry->
d_inode;
67 struct buffer_head *bh;
68 int item_num, entry_num;
85 next_pos = cpu_key_k_offset(&pos_key);
108 "vs-9000: found item %h does not match to dir we readdir %K",
111 "vs-9005 item_num == %d, item amount == %d",
116 "vs-9010: entry number is too big %d (%d)",
126 entry_num++, deh++) {
139 d_name + d_reclen > bh->b_data + bh->b_size) {
147 if (!d_name[d_reclen - 1])
148 d_reclen =
strlen(d_name);
158 if (is_privroot_deh(dentry, deh))
164 if (d_reclen <= 32) {
165 local_buf = small_buf;
183 memcpy(local_buf, d_name, d_reclen);
191 (dirent, local_buf, d_reclen, d_off, d_ino,
194 if (local_buf != small_buf) {
200 if (local_buf != small_buf) {
222 set_cpu_key_k_offset(&pos_key, next_pos);
232 set_cpu_key_k_offset(&pos_key,