Commit 6c00c6cc authored by Hirofumi Ogawa's avatar Hirofumi Ogawa Committed by Wim Van Sebroeck

[PATCH] remove fat_search_long() in vfat_add_entry()

This removes the fat_search_long() in the vfat_add_entry().  This path
is already checked by the vfs layer whether file/directory exists.  So,
we don't need the fat_search_long() in vfat_add_entry().

The following is the result of created the 1000 files,

2.5.39
root@devron (a)[1007]# time ../../create

real    0m2.761s
user    0m0.006s
sys     0m2.752s
root@devron (a)[1008]#

2.5.39 + patch
root@devron (a)[1007]# time ../../create

real    0m1.601s
user    0m0.008s
sys     0m1.575s
root@devron (a)[1008]#
parent a22b9070
...@@ -890,7 +890,6 @@ static int vfat_add_entry(struct inode *dir,struct qstr* qname, ...@@ -890,7 +890,6 @@ static int vfat_add_entry(struct inode *dir,struct qstr* qname,
struct msdos_dir_entry *dummy_de; struct msdos_dir_entry *dummy_de;
struct buffer_head *dummy_bh; struct buffer_head *dummy_bh;
int dummy_ino; int dummy_ino;
loff_t dummy;
dir_slots = (struct msdos_dir_slot *) dir_slots = (struct msdos_dir_slot *)
kmalloc(sizeof(struct msdos_dir_slot) * MSDOS_SLOTS, GFP_KERNEL); kmalloc(sizeof(struct msdos_dir_slot) * MSDOS_SLOTS, GFP_KERNEL);
...@@ -900,15 +899,6 @@ static int vfat_add_entry(struct inode *dir,struct qstr* qname, ...@@ -900,15 +899,6 @@ static int vfat_add_entry(struct inode *dir,struct qstr* qname,
len = qname->len; len = qname->len;
while (len && qname->name[len-1] == '.') while (len && qname->name[len-1] == '.')
len--; len--;
res = fat_search_long(dir, qname->name, len,
(MSDOS_SB(sb)->options.name_check != 's')
|| !MSDOS_SB(sb)->options.posixfs,
&dummy, &dummy);
if (res > 0) /* found */
res = -EEXIST;
if (res)
goto cleanup;
res = vfat_build_slots(dir, qname->name, len, res = vfat_build_slots(dir, qname->name, len,
dir_slots, &slots, is_dir); dir_slots, &slots, is_dir);
if (res < 0) if (res < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment