diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2008-04-28 05:16:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:47 -0400 |
commit | c7a6c4edc74ee5c3d990325fe93b6916f43499f4 (patch) | |
tree | 4bdeb0b0784bc17e5d54eb4c481fbb338ce9b642 /fs/vfat | |
parent | f22032ba8de2960a64a3dd9719fb5c99b1f1ae6e (diff) |
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.c | 10 |
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, | |||
472 | if (utf8) { | 472 | if (utf8) { |
473 | int name_len = strlen(name); | 473 | int name_len = strlen(name); |
474 | 474 | ||
475 | *outlen = utf8_mbstowcs((wchar_t *)outname, name, PAGE_SIZE); | 475 | *outlen = utf8_mbstowcs((wchar_t *)outname, name, PATH_MAX); |
476 | 476 | ||
477 | /* | 477 | /* |
478 | * We stripped '.'s before and set len appropriately, | 478 | * We stripped '.'s before and set len appropriately, |
@@ -565,7 +565,6 @@ static int vfat_build_slots(struct inode *dir, const unsigned char *name, | |||
565 | struct fat_mount_options *opts = &sbi->options; | 565 | struct fat_mount_options *opts = &sbi->options; |
566 | struct msdos_dir_slot *ps; | 566 | struct msdos_dir_slot *ps; |
567 | struct msdos_dir_entry *de; | 567 | struct msdos_dir_entry *de; |
568 | unsigned long page; | ||
569 | unsigned char cksum, lcase; | 568 | unsigned char cksum, lcase; |
570 | unsigned char msdos_name[MSDOS_NAME]; | 569 | unsigned char msdos_name[MSDOS_NAME]; |
571 | wchar_t *uname; | 570 | wchar_t *uname; |
@@ -575,11 +574,10 @@ static int vfat_build_slots(struct inode *dir, const unsigned char *name, | |||
575 | 574 | ||
576 | *nr_slots = 0; | 575 | *nr_slots = 0; |
577 | 576 | ||
578 | page = __get_free_page(GFP_KERNEL); | 577 | uname = __getname(); |
579 | if (!page) | 578 | if (!uname) |
580 | return -ENOMEM; | 579 | return -ENOMEM; |
581 | 580 | ||
582 | uname = (wchar_t *)page; | ||
583 | err = xlate_to_uni(name, len, (unsigned char *)uname, &ulen, &usize, | 581 | err = xlate_to_uni(name, len, (unsigned char *)uname, &ulen, &usize, |
584 | opts->unicode_xlate, opts->utf8, sbi->nls_io); | 582 | opts->unicode_xlate, opts->utf8, sbi->nls_io); |
585 | if (err) | 583 | if (err) |
@@ -631,7 +629,7 @@ shortname: | |||
631 | de->starthi = cpu_to_le16(cluster >> 16); | 629 | de->starthi = cpu_to_le16(cluster >> 16); |
632 | de->size = 0; | 630 | de->size = 0; |
633 | out_free: | 631 | out_free: |
634 | free_page(page); | 632 | __putname(uname); |
635 | return err; | 633 | return err; |
636 | } | 634 | } |
637 | 635 | ||