diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-28 14:14:04 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-28 14:14:04 -0500 |
commit | 71b86f562b5eb6f94ea00bba060caa64d0137969 (patch) | |
tree | 63d982e09a9cb934fe656afe115031c0a9dc5e4a /fs/gfs2/inode.c | |
parent | 94aabbd99370f738da4f6cb4ea0b94cd9024002f (diff) |
[GFS2] Further updates to dir and logging code
This reduces the size of the directory code by about 3k and gets
readdir() to use the functions which were introduced in the previous
directory code update.
Two memory allocations are merged into one. Eliminates zeroing of some
buffers which were never used before they were initialised by
other data.
There is still scope for further improvement in the directory code.
On the logging side, a hand created mutex has been replaced by a
standard Linux mutex in the log allocation code.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index d403d51d5b0f..6140c2434e85 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/posix_acl.h> | 15 | #include <linux/posix_acl.h> |
16 | #include <linux/sort.h> | 16 | #include <linux/sort.h> |
17 | #include <linux/gfs2_ondisk.h> | 17 | #include <linux/gfs2_ondisk.h> |
18 | #include <linux/crc32.h> | ||
18 | #include <asm/semaphore.h> | 19 | #include <asm/semaphore.h> |
19 | 20 | ||
20 | #include "gfs2.h" | 21 | #include "gfs2.h" |
@@ -701,9 +702,7 @@ int gfs2_change_nlink(struct gfs2_inode *ip, int diff) | |||
701 | struct inode *gfs2_lookup_simple(struct inode *dip, const char *name) | 702 | struct inode *gfs2_lookup_simple(struct inode *dip, const char *name) |
702 | { | 703 | { |
703 | struct qstr qstr; | 704 | struct qstr qstr; |
704 | qstr.name = name; | 705 | gfs2_str2qstr(&qstr, name); |
705 | qstr.len = strlen(name); | ||
706 | qstr.hash = gfs2_disk_hash(qstr.name, qstr.len); | ||
707 | return gfs2_lookupi(dip, &qstr, 1, NULL); | 706 | return gfs2_lookupi(dip, &qstr, 1, NULL); |
708 | } | 707 | } |
709 | 708 | ||
@@ -1389,9 +1388,7 @@ int gfs2_rmdiri(struct gfs2_inode *dip, struct qstr *name, | |||
1389 | if (error) | 1388 | if (error) |
1390 | return error; | 1389 | return error; |
1391 | 1390 | ||
1392 | dotname.len = 1; | 1391 | gfs2_str2qstr(&dotname, "."); |
1393 | dotname.name = "."; | ||
1394 | dotname.hash = gfs2_disk_hash(dotname.name, dotname.len); | ||
1395 | error = gfs2_dir_del(ip, &dotname); | 1392 | error = gfs2_dir_del(ip, &dotname); |
1396 | if (error) | 1393 | if (error) |
1397 | return error; | 1394 | return error; |
@@ -1487,10 +1484,7 @@ int gfs2_ok_to_move(struct gfs2_inode *this, struct gfs2_inode *to) | |||
1487 | struct qstr dotdot; | 1484 | struct qstr dotdot; |
1488 | int error = 0; | 1485 | int error = 0; |
1489 | 1486 | ||
1490 | memset(&dotdot, 0, sizeof(struct qstr)); | 1487 | gfs2_str2qstr(&dotdot, ".."); |
1491 | dotdot.name = ".."; | ||
1492 | dotdot.len = 2; | ||
1493 | dotdot.hash = gfs2_disk_hash(dotdot.name, dotdot.len); | ||
1494 | 1488 | ||
1495 | igrab(dir); | 1489 | igrab(dir); |
1496 | 1490 | ||