diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-20 17:30:04 (GMT) |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-20 17:30:04 (GMT) |
commit | c752666c17f870fa8ae9f16804dd457e9e6daaec (patch) | |
tree | c3c48383f386a24edbdf3c6292f25b587e6d9368 /fs/gfs2/ondisk.c | |
parent | 419c93e0b6b9eef0bf26b8ad415f2a5bf4300119 (diff) | |
download | linux-c752666c17f870fa8ae9f16804dd457e9e6daaec.tar.xz |
[GFS2] Fix bug in directory code and tidy up
Due to a typo, the dir leaf split operation was (for the first
split in a directory) writing the new hash vaules at the
wrong offset. This is now fixed.
Also some other tidy ups are included:
- We use GFS2's hash function for dentries (see ops_dentry.c) so that
we don't have to keep recalculating the hash values.
- A lot of common code is eliminated between the various directory
lookup routines.
- Better error checking on directory lookup (previously different
routines checked for different errors)
- The leaf split operation has a couple of redundant operations
removed from it, so it should be faster.
There is still further scope for further clean ups in the directory
code, and readdir in particular could do with slimming down a bit.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ondisk.c')
-rw-r--r-- | fs/gfs2/ondisk.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/gfs2/ondisk.c b/fs/gfs2/ondisk.c index 5a0bdc2..3be060f 100644 --- a/fs/gfs2/ondisk.c +++ b/fs/gfs2/ondisk.c @@ -64,7 +64,7 @@ void gfs2_inum_in(struct gfs2_inum *no, char *buf) no->no_addr = be64_to_cpu(str->no_addr); } -void gfs2_inum_out(struct gfs2_inum *no, char *buf) +void gfs2_inum_out(const struct gfs2_inum *no, char *buf) { struct gfs2_inum *str = (struct gfs2_inum *)buf; @@ -342,17 +342,6 @@ void gfs2_dirent_print(struct gfs2_dirent *de, char *name) printk(KERN_INFO " name = %s\n", buf); } -void gfs2_leaf_in(struct gfs2_leaf *lf, char *buf) -{ - struct gfs2_leaf *str = (struct gfs2_leaf *)buf; - - gfs2_meta_header_in(&lf->lf_header, buf); - lf->lf_depth = be16_to_cpu(str->lf_depth); - lf->lf_entries = be16_to_cpu(str->lf_entries); - lf->lf_dirent_format = be32_to_cpu(str->lf_dirent_format); - lf->lf_next = be64_to_cpu(str->lf_next); -} - void gfs2_leaf_print(struct gfs2_leaf *lf) { gfs2_meta_header_print(&lf->lf_header); |