2 * fs/logfs/dir.c - directory-related code
4 * As should be obvious for Linux kernel code, license is GPLv2
6 * Copyright (c) 2005-2008 Joern Engel <joern@logfs.org>
12 * Atomic dir operations
14 * Directory operations are by default not atomic. Dentries and Inodes are
15 * created/removed/altered in seperate operations. Therefore we need to do
16 * a small amount of journaling.
18 * Create, link, mkdir, mknod and symlink all share the same function to do
19 * the work: __logfs_create. This function works in two atomic steps:
20 * 1. allocate inode (remember in journal)
21 * 2. allocate dentry (clear journal)
23 * As we can only get interrupted between the two, when the inode we just
24 * created is simply stored in the anchor. On next mount, if we were
25 * interrupted, we delete the inode. From a users point of view the
26 * operation never happened.
28 * Unlink and rmdir also share the same function: unlink. Again, this
29 * function works in two atomic steps
30 * 1. remove dentry (remember inode in journal)
31 * 2. unlink inode (clear journal)
33 * And again, on the next mount, if we were interrupted, we delete the inode.
34 * From a users point of view the operation succeeded.
36 * Rename is the real pain to deal with, harder than all the other methods
37 * combined. Depending on the circumstances we can run into three cases.
38 * A "target rename" where the target dentry already existed, a "local
39 * rename" where both parent directories are identical or a "cross-directory
40 * rename" in the remaining case.
42 * Local rename is atomic, as the old dentry is simply rewritten with a new
45 * Cross-directory rename works in two steps, similar to __logfs_create and
47 * 1. Write new dentry (remember old dentry in journal)
48 * 2. Remove old dentry (clear journal)
50 * Here we remember a dentry instead of an inode. On next mount, if we were
51 * interrupted, we delete the dentry. From a users point of view, the
52 * operation succeeded.
54 * Target rename works in three atomic steps:
55 * 1. Attach old inode to new dentry (remember old dentry and new inode)
56 * 2. Remove old dentry (still remember the new inode)
57 * 3. Remove victim inode
59 * Here we remember both an inode an a dentry. If we get interrupted
60 * between steps 1 and 2, we delete both the dentry and the inode. If
61 * we get interrupted between steps 2 and 3, we delete just the inode.
62 * In either case, the remaining objects are deleted on next mount. From
63 * a users point of view, the operation succeeded.
66 static int write_dir(struct inode
*dir
, struct logfs_disk_dentry
*dd
,
69 return logfs_inode_write(dir
, dd
, sizeof(*dd
), pos
, WF_LOCK
, NULL
);
72 static int write_inode(struct inode
*inode
)
74 return __logfs_write_inode(inode
, WF_LOCK
);
77 static s64
dir_seek_data(struct inode
*inode
, s64 pos
)
79 s64 new_pos
= logfs_seek_data(inode
, pos
);
81 return max(pos
, new_pos
- 1);
84 static int beyond_eof(struct inode
*inode
, loff_t bix
)
86 loff_t pos
= bix
<< inode
->i_sb
->s_blocksize_bits
;
87 return pos
>= i_size_read(inode
);
91 * Prime value was chosen to be roughly 256 + 26. r5 hash uses 11,
92 * so short names (len <= 9) don't even occupy the complete 32bit name
93 * space. A prime >256 ensures short names quickly spread the 32bit
94 * name space. Add about 26 for the estimated amount of information
95 * of each character and pick a prime nearby, preferrably a bit-sparse
98 static u32
hash_32(const char *s
, int len
, u32 seed
)
103 for (i
= 0; i
< len
; i
++)
104 hash
= hash
* 293 + s
[i
];
109 * We have to satisfy several conflicting requirements here. Small
110 * directories should stay fairly compact and not require too many
111 * indirect blocks. The number of possible locations for a given hash
112 * should be small to make lookup() fast. And we should try hard not
113 * to overflow the 32bit name space or nfs and 32bit host systems will
116 * So we use the following scheme. First we reduce the hash to 0..15
117 * and try a direct block. If that is occupied we reduce the hash to
118 * 16..255 and try an indirect block. Same for 2x and 3x indirect
119 * blocks. Lastly we reduce the hash to 0x800_0000 .. 0xffff_ffff,
120 * but use buckets containing eight entries instead of a single one.
122 * Using 16 entries should allow for a reasonable amount of hash
123 * collisions, so the 32bit name space can be packed fairly tight
124 * before overflowing. Oh and currently we don't overflow but return
127 * How likely are collisions? Doing the appropriate math is beyond me
128 * and the Bronstein textbook. But running a test program to brute
129 * force collisions for a couple of days showed that on average the
130 * first collision occurs after 598M entries, with 290M being the
131 * smallest result. Obviously 21 entries could already cause a
132 * collision if all entries are carefully chosen.
134 static pgoff_t
hash_index(u32 hash
, int round
)
138 return hash
% I0_BLOCKS
;
140 return I0_BLOCKS
+ hash
% (I1_BLOCKS
- I0_BLOCKS
);
142 return I1_BLOCKS
+ hash
% (I2_BLOCKS
- I1_BLOCKS
);
144 return I2_BLOCKS
+ hash
% (I3_BLOCKS
- I2_BLOCKS
);
146 return I3_BLOCKS
+ 16 * (hash
% (((1<<31) - I3_BLOCKS
) / 16))
152 static struct page
*logfs_get_dd_page(struct inode
*dir
, struct dentry
*dentry
)
154 struct qstr
*name
= &dentry
->d_name
;
156 struct logfs_disk_dentry
*dd
;
157 u32 hash
= hash_32(name
->name
, name
->len
, 0);
161 if (name
->len
> LOGFS_MAX_NAMELEN
)
162 return ERR_PTR(-ENAMETOOLONG
);
164 for (round
= 0; round
< 20; round
++) {
165 index
= hash_index(hash
, round
);
167 if (beyond_eof(dir
, index
))
169 if (!logfs_exist_block(dir
, index
))
171 page
= read_cache_page(dir
->i_mapping
, index
,
172 (filler_t
*)logfs_readpage
, NULL
);
175 dd
= kmap_atomic(page
, KM_USER0
);
176 BUG_ON(dd
->namelen
== 0);
178 if (name
->len
!= be16_to_cpu(dd
->namelen
) ||
179 memcmp(name
->name
, dd
->name
, name
->len
)) {
180 kunmap_atomic(dd
, KM_USER0
);
181 page_cache_release(page
);
185 kunmap_atomic(dd
, KM_USER0
);
191 static int logfs_remove_inode(struct inode
*inode
)
196 ret
= write_inode(inode
);
197 LOGFS_BUG_ON(ret
, inode
->i_sb
);
201 static void abort_transaction(struct inode
*inode
, struct logfs_transaction
*ta
)
203 if (logfs_inode(inode
)->li_block
)
204 logfs_inode(inode
)->li_block
->ta
= NULL
;
208 static int logfs_unlink(struct inode
*dir
, struct dentry
*dentry
)
210 struct logfs_super
*super
= logfs_super(dir
->i_sb
);
211 struct inode
*inode
= dentry
->d_inode
;
212 struct logfs_transaction
*ta
;
217 ta
= kzalloc(sizeof(*ta
), GFP_KERNEL
);
221 ta
->state
= UNLINK_1
;
222 ta
->ino
= inode
->i_ino
;
224 inode
->i_ctime
= dir
->i_ctime
= dir
->i_mtime
= CURRENT_TIME
;
226 page
= logfs_get_dd_page(dir
, dentry
);
233 return PTR_ERR(page
);
236 page_cache_release(page
);
238 mutex_lock(&super
->s_dirop_mutex
);
239 logfs_add_transaction(dir
, ta
);
241 ret
= logfs_delete(dir
, index
, NULL
);
243 ret
= write_inode(dir
);
246 abort_transaction(dir
, ta
);
247 printk(KERN_ERR
"LOGFS: unable to delete inode\n");
251 ta
->state
= UNLINK_2
;
252 logfs_add_transaction(inode
, ta
);
253 ret
= logfs_remove_inode(inode
);
255 mutex_unlock(&super
->s_dirop_mutex
);
259 static inline int logfs_empty_dir(struct inode
*dir
)
263 data
= logfs_seek_data(dir
, 0) << dir
->i_sb
->s_blocksize_bits
;
264 return data
>= i_size_read(dir
);
267 static int logfs_rmdir(struct inode
*dir
, struct dentry
*dentry
)
269 struct inode
*inode
= dentry
->d_inode
;
271 if (!logfs_empty_dir(inode
))
274 return logfs_unlink(dir
, dentry
);
277 /* FIXME: readdir currently has it's own dir_walk code. I don't see a good
278 * way to combine the two copies */
279 #define IMPLICIT_NODES 2
280 static int __logfs_readdir(struct file
*file
, void *buf
, filldir_t filldir
)
282 struct inode
*dir
= file
->f_dentry
->d_inode
;
283 loff_t pos
= file
->f_pos
- IMPLICIT_NODES
;
285 struct logfs_disk_dentry
*dd
;
290 if (beyond_eof(dir
, pos
))
292 if (!logfs_exist_block(dir
, pos
)) {
294 pos
= dir_seek_data(dir
, pos
);
297 page
= read_cache_page(dir
->i_mapping
, pos
,
298 (filler_t
*)logfs_readpage
, NULL
);
300 return PTR_ERR(page
);
301 dd
= kmap_atomic(page
, KM_USER0
);
302 BUG_ON(dd
->namelen
== 0);
304 full
= filldir(buf
, (char *)dd
->name
, be16_to_cpu(dd
->namelen
),
305 pos
, be64_to_cpu(dd
->ino
), dd
->type
);
306 kunmap_atomic(dd
, KM_USER0
);
307 page_cache_release(page
);
312 file
->f_pos
= pos
+ IMPLICIT_NODES
;
316 static int logfs_readdir(struct file
*file
, void *buf
, filldir_t filldir
)
318 struct inode
*inode
= file
->f_dentry
->d_inode
;
319 ino_t pino
= parent_ino(file
->f_dentry
);
325 if (file
->f_pos
== 0) {
326 if (filldir(buf
, ".", 1, 1, inode
->i_ino
, DT_DIR
) < 0)
330 if (file
->f_pos
== 1) {
331 if (filldir(buf
, "..", 2, 2, pino
, DT_DIR
) < 0)
336 err
= __logfs_readdir(file
, buf
, filldir
);
340 static void logfs_set_name(struct logfs_disk_dentry
*dd
, struct qstr
*name
)
342 dd
->namelen
= cpu_to_be16(name
->len
);
343 memcpy(dd
->name
, name
->name
, name
->len
);
346 static struct dentry
*logfs_lookup(struct inode
*dir
, struct dentry
*dentry
,
347 struct nameidata
*nd
)
350 struct logfs_disk_dentry
*dd
;
355 page
= logfs_get_dd_page(dir
, dentry
);
357 return ERR_CAST(page
);
363 dd
= kmap_atomic(page
, KM_USER0
);
364 ino
= be64_to_cpu(dd
->ino
);
365 kunmap_atomic(dd
, KM_USER0
);
366 page_cache_release(page
);
368 inode
= logfs_iget(dir
->i_sb
, ino
);
370 printk(KERN_ERR
"LogFS: Cannot read inode #%llx for dentry (%lx, %lx)n",
371 ino
, dir
->i_ino
, index
);
372 return ERR_CAST(inode
);
374 return d_splice_alias(inode
, dentry
);
377 static void grow_dir(struct inode
*dir
, loff_t index
)
379 index
= (index
+ 1) << dir
->i_sb
->s_blocksize_bits
;
380 if (i_size_read(dir
) < index
)
381 i_size_write(dir
, index
);
384 static int logfs_write_dir(struct inode
*dir
, struct dentry
*dentry
,
388 struct logfs_disk_dentry
*dd
;
389 u32 hash
= hash_32(dentry
->d_name
.name
, dentry
->d_name
.len
, 0);
393 for (round
= 0; round
< 20; round
++) {
394 index
= hash_index(hash
, round
);
396 if (logfs_exist_block(dir
, index
))
398 page
= find_or_create_page(dir
->i_mapping
, index
, GFP_KERNEL
);
402 dd
= kmap_atomic(page
, KM_USER0
);
403 memset(dd
, 0, sizeof(*dd
));
404 dd
->ino
= cpu_to_be64(inode
->i_ino
);
405 dd
->type
= logfs_type(inode
);
406 logfs_set_name(dd
, &dentry
->d_name
);
407 kunmap_atomic(dd
, KM_USER0
);
409 err
= logfs_write_buf(dir
, page
, WF_LOCK
);
411 page_cache_release(page
);
413 grow_dir(dir
, index
);
416 /* FIXME: Is there a better return value? In most cases neither
417 * the filesystem nor the directory are full. But we have had
418 * too many collisions for this particular hash and no fallback.
423 static int __logfs_create(struct inode
*dir
, struct dentry
*dentry
,
424 struct inode
*inode
, const char *dest
, long destlen
)
426 struct logfs_super
*super
= logfs_super(dir
->i_sb
);
427 struct logfs_inode
*li
= logfs_inode(inode
);
428 struct logfs_transaction
*ta
;
431 ta
= kzalloc(sizeof(*ta
), GFP_KERNEL
);
435 ta
->state
= CREATE_1
;
436 ta
->ino
= inode
->i_ino
;
437 mutex_lock(&super
->s_dirop_mutex
);
438 logfs_add_transaction(inode
, ta
);
442 ret
= logfs_inode_write(inode
, dest
, destlen
, 0, WF_LOCK
, NULL
);
444 ret
= write_inode(inode
);
446 /* creat/mkdir/mknod */
447 ret
= write_inode(inode
);
450 abort_transaction(inode
, ta
);
451 li
->li_flags
|= LOGFS_IF_STILLBORN
;
452 /* FIXME: truncate symlink */
458 ta
->state
= CREATE_2
;
459 logfs_add_transaction(dir
, ta
);
460 ret
= logfs_write_dir(dir
, dentry
, inode
);
463 ret
= write_inode(dir
);
466 logfs_del_transaction(dir
, ta
);
467 ta
->state
= CREATE_2
;
468 logfs_add_transaction(inode
, ta
);
469 logfs_remove_inode(inode
);
473 d_instantiate(dentry
, inode
);
475 mutex_unlock(&super
->s_dirop_mutex
);
479 static int logfs_mkdir(struct inode
*dir
, struct dentry
*dentry
, int mode
)
484 * FIXME: why do we have to fill in S_IFDIR, while the mode is
485 * correct for mknod, creat, etc.? Smells like the vfs *should*
486 * do it for us but for some reason fails to do so.
488 inode
= logfs_new_inode(dir
, S_IFDIR
| mode
);
490 return PTR_ERR(inode
);
492 inode
->i_op
= &logfs_dir_iops
;
493 inode
->i_fop
= &logfs_dir_fops
;
495 return __logfs_create(dir
, dentry
, inode
, NULL
, 0);
498 static int logfs_create(struct inode
*dir
, struct dentry
*dentry
, int mode
,
499 struct nameidata
*nd
)
503 inode
= logfs_new_inode(dir
, mode
);
505 return PTR_ERR(inode
);
507 inode
->i_op
= &logfs_reg_iops
;
508 inode
->i_fop
= &logfs_reg_fops
;
509 inode
->i_mapping
->a_ops
= &logfs_reg_aops
;
511 return __logfs_create(dir
, dentry
, inode
, NULL
, 0);
514 static int logfs_mknod(struct inode
*dir
, struct dentry
*dentry
, int mode
,
519 if (dentry
->d_name
.len
> LOGFS_MAX_NAMELEN
)
520 return -ENAMETOOLONG
;
522 inode
= logfs_new_inode(dir
, mode
);
524 return PTR_ERR(inode
);
526 init_special_inode(inode
, mode
, rdev
);
528 return __logfs_create(dir
, dentry
, inode
, NULL
, 0);
531 static int logfs_symlink(struct inode
*dir
, struct dentry
*dentry
,
535 size_t destlen
= strlen(target
) + 1;
537 if (destlen
> dir
->i_sb
->s_blocksize
)
538 return -ENAMETOOLONG
;
540 inode
= logfs_new_inode(dir
, S_IFLNK
| 0777);
542 return PTR_ERR(inode
);
544 inode
->i_op
= &logfs_symlink_iops
;
545 inode
->i_mapping
->a_ops
= &logfs_reg_aops
;
547 return __logfs_create(dir
, dentry
, inode
, target
, destlen
);
550 static int logfs_permission(struct inode
*inode
, int mask
)
552 return generic_permission(inode
, mask
, NULL
);
555 static int logfs_link(struct dentry
*old_dentry
, struct inode
*dir
,
556 struct dentry
*dentry
)
558 struct inode
*inode
= old_dentry
->d_inode
;
560 if (inode
->i_nlink
>= LOGFS_LINK_MAX
)
563 inode
->i_ctime
= dir
->i_ctime
= dir
->i_mtime
= CURRENT_TIME
;
564 atomic_inc(&inode
->i_count
);
566 mark_inode_dirty_sync(inode
);
568 return __logfs_create(dir
, dentry
, inode
, NULL
, 0);
571 static int logfs_get_dd(struct inode
*dir
, struct dentry
*dentry
,
572 struct logfs_disk_dentry
*dd
, loff_t
*pos
)
577 page
= logfs_get_dd_page(dir
, dentry
);
579 return PTR_ERR(page
);
581 map
= kmap_atomic(page
, KM_USER0
);
582 memcpy(dd
, map
, sizeof(*dd
));
583 kunmap_atomic(map
, KM_USER0
);
584 page_cache_release(page
);
588 static int logfs_delete_dd(struct inode
*dir
, loff_t pos
)
591 * Getting called with pos somewhere beyond eof is either a goofup
592 * within this file or means someone maliciously edited the
593 * (crc-protected) journal.
595 BUG_ON(beyond_eof(dir
, pos
));
596 dir
->i_ctime
= dir
->i_mtime
= CURRENT_TIME
;
597 log_dir(" Delete dentry (%lx, %llx)\n", dir
->i_ino
, pos
);
598 return logfs_delete(dir
, pos
, NULL
);
602 * Cross-directory rename, target does not exist. Just a little nasty.
603 * Create a new dentry in the target dir, then remove the old dentry,
604 * all the while taking care to remember our operation in the journal.
606 static int logfs_rename_cross(struct inode
*old_dir
, struct dentry
*old_dentry
,
607 struct inode
*new_dir
, struct dentry
*new_dentry
)
609 struct logfs_super
*super
= logfs_super(old_dir
->i_sb
);
610 struct logfs_disk_dentry dd
;
611 struct logfs_transaction
*ta
;
615 /* 1. locate source dd */
616 err
= logfs_get_dd(old_dir
, old_dentry
, &dd
, &pos
);
620 ta
= kzalloc(sizeof(*ta
), GFP_KERNEL
);
624 ta
->state
= CROSS_RENAME_1
;
625 ta
->dir
= old_dir
->i_ino
;
628 /* 2. write target dd */
629 mutex_lock(&super
->s_dirop_mutex
);
630 logfs_add_transaction(new_dir
, ta
);
631 err
= logfs_write_dir(new_dir
, new_dentry
, old_dentry
->d_inode
);
633 err
= write_inode(new_dir
);
636 super
->s_rename_dir
= 0;
637 super
->s_rename_pos
= 0;
638 abort_transaction(new_dir
, ta
);
642 /* 3. remove source dd */
643 ta
->state
= CROSS_RENAME_2
;
644 logfs_add_transaction(old_dir
, ta
);
645 err
= logfs_delete_dd(old_dir
, pos
);
647 err
= write_inode(old_dir
);
648 LOGFS_BUG_ON(err
, old_dir
->i_sb
);
650 mutex_unlock(&super
->s_dirop_mutex
);
654 static int logfs_replace_inode(struct inode
*dir
, struct dentry
*dentry
,
655 struct logfs_disk_dentry
*dd
, struct inode
*inode
)
660 err
= logfs_get_dd(dir
, dentry
, dd
, &pos
);
663 dd
->ino
= cpu_to_be64(inode
->i_ino
);
664 dd
->type
= logfs_type(inode
);
666 err
= write_dir(dir
, dd
, pos
);
669 log_dir("Replace dentry (%lx, %llx) %s -> %llx\n", dir
->i_ino
, pos
,
670 dd
->name
, be64_to_cpu(dd
->ino
));
671 return write_inode(dir
);
674 /* Target dentry exists - the worst case. We need to attach the source
675 * inode to the target dentry, then remove the orphaned target inode and
678 static int logfs_rename_target(struct inode
*old_dir
, struct dentry
*old_dentry
,
679 struct inode
*new_dir
, struct dentry
*new_dentry
)
681 struct logfs_super
*super
= logfs_super(old_dir
->i_sb
);
682 struct inode
*old_inode
= old_dentry
->d_inode
;
683 struct inode
*new_inode
= new_dentry
->d_inode
;
684 int isdir
= S_ISDIR(old_inode
->i_mode
);
685 struct logfs_disk_dentry dd
;
686 struct logfs_transaction
*ta
;
690 BUG_ON(isdir
!= S_ISDIR(new_inode
->i_mode
));
692 if (!logfs_empty_dir(new_inode
))
696 /* 1. locate source dd */
697 err
= logfs_get_dd(old_dir
, old_dentry
, &dd
, &pos
);
701 ta
= kzalloc(sizeof(*ta
), GFP_KERNEL
);
705 ta
->state
= TARGET_RENAME_1
;
706 ta
->dir
= old_dir
->i_ino
;
708 ta
->ino
= new_inode
->i_ino
;
710 /* 2. attach source inode to target dd */
711 mutex_lock(&super
->s_dirop_mutex
);
712 logfs_add_transaction(new_dir
, ta
);
713 err
= logfs_replace_inode(new_dir
, new_dentry
, &dd
, old_inode
);
715 super
->s_rename_dir
= 0;
716 super
->s_rename_pos
= 0;
717 super
->s_victim_ino
= 0;
718 abort_transaction(new_dir
, ta
);
722 /* 3. remove source dd */
723 ta
->state
= TARGET_RENAME_2
;
724 logfs_add_transaction(old_dir
, ta
);
725 err
= logfs_delete_dd(old_dir
, pos
);
727 err
= write_inode(old_dir
);
728 LOGFS_BUG_ON(err
, old_dir
->i_sb
);
730 /* 4. remove target inode */
731 ta
->state
= TARGET_RENAME_3
;
732 logfs_add_transaction(new_inode
, ta
);
733 err
= logfs_remove_inode(new_inode
);
736 mutex_unlock(&super
->s_dirop_mutex
);
740 static int logfs_rename(struct inode
*old_dir
, struct dentry
*old_dentry
,
741 struct inode
*new_dir
, struct dentry
*new_dentry
)
743 if (new_dentry
->d_inode
)
744 return logfs_rename_target(old_dir
, old_dentry
,
745 new_dir
, new_dentry
);
746 return logfs_rename_cross(old_dir
, old_dentry
, new_dir
, new_dentry
);
749 /* No locking done here, as this is called before .get_sb() returns. */
750 int logfs_replay_journal(struct super_block
*sb
)
752 struct logfs_super
*super
= logfs_super(sb
);
757 if (super
->s_victim_ino
) {
758 /* delete victim inode */
759 ino
= super
->s_victim_ino
;
760 printk(KERN_INFO
"LogFS: delete unmapped inode #%llx\n", ino
);
761 inode
= logfs_iget(sb
, ino
);
765 LOGFS_BUG_ON(i_size_read(inode
) > 0, sb
);
766 super
->s_victim_ino
= 0;
767 err
= logfs_remove_inode(inode
);
770 super
->s_victim_ino
= ino
;
774 if (super
->s_rename_dir
) {
775 /* delete old dd from rename */
776 ino
= super
->s_rename_dir
;
777 pos
= super
->s_rename_pos
;
778 printk(KERN_INFO
"LogFS: delete unbacked dentry (%llx, %llx)\n",
780 inode
= logfs_iget(sb
, ino
);
784 super
->s_rename_dir
= 0;
785 super
->s_rename_pos
= 0;
786 err
= logfs_delete_dd(inode
, pos
);
789 super
->s_rename_dir
= ino
;
790 super
->s_rename_pos
= pos
;
800 const struct inode_operations logfs_symlink_iops
= {
801 .readlink
= generic_readlink
,
802 .follow_link
= page_follow_link_light
,
805 const struct inode_operations logfs_dir_iops
= {
806 .create
= logfs_create
,
808 .lookup
= logfs_lookup
,
809 .mkdir
= logfs_mkdir
,
810 .mknod
= logfs_mknod
,
811 .rename
= logfs_rename
,
812 .rmdir
= logfs_rmdir
,
813 .permission
= logfs_permission
,
814 .symlink
= logfs_symlink
,
815 .unlink
= logfs_unlink
,
817 const struct file_operations logfs_dir_fops
= {
818 .fsync
= logfs_fsync
,
819 .ioctl
= logfs_ioctl
,
820 .readdir
= logfs_readdir
,
821 .read
= generic_read_dir
,