summaryrefslogtreecommitdiffstats
path: root/fs/vfat
diff options
context:
space:
mode:
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2008-04-28 02:16:29 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 08:58:47 -0700
commitc7a6c4edc74ee5c3d990325fe93b6916f43499f4 (patch)
tree4bdeb0b0784bc17e5d54eb4c481fbb338ce9b642 /fs/vfat
parentf22032ba8de2960a64a3dd9719fb5c99b1f1ae6e (diff)
downloadlinux-c7a6c4edc74ee5c3d990325fe93b6916f43499f4.tar.bz2
fat: use __getname()
__getname() is faster than __get_free_page(). Use it. Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/vfat')
-rw-r--r--fs/vfat/namei.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/vfat/namei.c b/fs/vfat/namei.c
index ab4f3da770f0..5b66162d0747 100644
--- a/fs/vfat/namei.c
+++ b/fs/vfat/namei.c
@@ -472,7 +472,7 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname,
if (utf8) {
int name_len = strlen(name);
- *outlen = utf8_mbstowcs((wchar_t *)outname, name, PAGE_SIZE);
+ *outlen = utf8_mbstowcs((wchar_t *)outname, name, PATH_MAX);
/*
* We stripped '.'s before and set len appropriately,
@@ -565,7 +565,6 @@ static int vfat_build_slots(struct inode *dir, const unsigned char *name,
struct fat_mount_options *opts = &sbi->options;
struct msdos_dir_slot *ps;
struct msdos_dir_entry *de;
- unsigned long page;
unsigned char cksum, lcase;
unsigned char msdos_name[MSDOS_NAME];
wchar_t *uname;
@@ -575,11 +574,10 @@ static int vfat_build_slots(struct inode *dir, const unsigned char *name,
*nr_slots = 0;
- page = __get_free_page(GFP_KERNEL);
- if (!page)
+ uname = __getname();
+ if (!uname)
return -ENOMEM;
- uname = (wchar_t *)page;
err = xlate_to_uni(name, len, (unsigned char *)uname, &ulen, &usize,
opts->unicode_xlate, opts->utf8, sbi->nls_io);
if (err)
@@ -631,7 +629,7 @@ shortname:
de->starthi = cpu_to_le16(cluster >> 16);
de->size = 0;
out_free:
- free_page(page);
+ __putname(uname);
return err;
}