summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-03-28 21:14:04 +0200
committerSteven Whitehouse <swhiteho@redhat.com>2006-03-28 21:14:04 +0200
commit71b86f562b5eb6f94ea00bba060caa64d0137969 (patch)
tree63d982e09a9cb934fe656afe115031c0a9dc5e4a /fs/gfs2/inode.c
parent[GFS2] Remove ioctl support (diff)
downloadlinux-71b86f562b5eb6f94ea00bba060caa64d0137969.tar.xz
linux-71b86f562b5eb6f94ea00bba060caa64d0137969.zip
[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.c14
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 @@
#include <linux/posix_acl.h>
#include <linux/sort.h>
#include <linux/gfs2_ondisk.h>
+#include <linux/crc32.h>
#include <asm/semaphore.h>
#include "gfs2.h"
@@ -701,9 +702,7 @@ int gfs2_change_nlink(struct gfs2_inode *ip, int diff)
struct inode *gfs2_lookup_simple(struct inode *dip, const char *name)
{
struct qstr qstr;
- qstr.name = name;
- qstr.len = strlen(name);
- qstr.hash = gfs2_disk_hash(qstr.name, qstr.len);
+ gfs2_str2qstr(&qstr, name);
return gfs2_lookupi(dip, &qstr, 1, NULL);
}
@@ -1389,9 +1388,7 @@ int gfs2_rmdiri(struct gfs2_inode *dip, struct qstr *name,
if (error)
return error;
- dotname.len = 1;
- dotname.name = ".";
- dotname.hash = gfs2_disk_hash(dotname.name, dotname.len);
+ gfs2_str2qstr(&dotname, ".");
error = gfs2_dir_del(ip, &dotname);
if (error)
return error;
@@ -1487,10 +1484,7 @@ int gfs2_ok_to_move(struct gfs2_inode *this, struct gfs2_inode *to)
struct qstr dotdot;
int error = 0;
- memset(&dotdot, 0, sizeof(struct qstr));
- dotdot.name = "..";
- dotdot.len = 2;
- dotdot.hash = gfs2_disk_hash(dotdot.name, dotdot.len);
+ gfs2_str2qstr(&dotdot, "..");
igrab(dir);