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/fat | |
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/fat')
-rw-r--r-- | fs/fat/dir.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 7b62ffb663f6..486725ee99ae 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c | |||
@@ -247,7 +247,7 @@ static int fat_parse_long(struct inode *dir, loff_t *pos, | |||
247 | unsigned char id, slot, slots, alias_checksum; | 247 | unsigned char id, slot, slots, alias_checksum; |
248 | 248 | ||
249 | if (!*unicode) { | 249 | if (!*unicode) { |
250 | *unicode = (wchar_t *)__get_free_page(GFP_KERNEL); | 250 | *unicode = __getname(); |
251 | if (!*unicode) { | 251 | if (!*unicode) { |
252 | brelse(*bh); | 252 | brelse(*bh); |
253 | return -ENOMEM; | 253 | return -ENOMEM; |
@@ -327,7 +327,7 @@ int fat_search_long(struct inode *inode, const unsigned char *name, | |||
327 | loff_t cpos = 0; | 327 | loff_t cpos = 0; |
328 | int chl, i, j, last_u, err; | 328 | int chl, i, j, last_u, err; |
329 | 329 | ||
330 | bufname = (unsigned char*)__get_free_page(GFP_KERNEL); | 330 | bufname = __getname(); |
331 | if (!bufname) | 331 | if (!bufname) |
332 | return -ENOMEM; | 332 | return -ENOMEM; |
333 | 333 | ||
@@ -396,8 +396,8 @@ parse_record: | |||
396 | 396 | ||
397 | bufuname[last_u] = 0x0000; | 397 | bufuname[last_u] = 0x0000; |
398 | xlate_len = utf8 | 398 | xlate_len = utf8 |
399 | ?utf8_wcstombs(bufname, bufuname, PAGE_SIZE) | 399 | ?utf8_wcstombs(bufname, bufuname, PATH_MAX) |
400 | :uni16_to_x8(bufname, bufuname, PAGE_SIZE, uni_xlate, nls_io); | 400 | :uni16_to_x8(bufname, bufuname, PATH_MAX, uni_xlate, nls_io); |
401 | if (xlate_len == name_len) | 401 | if (xlate_len == name_len) |
402 | if ((!anycase && !memcmp(name, bufname, xlate_len)) || | 402 | if ((!anycase && !memcmp(name, bufname, xlate_len)) || |
403 | (anycase && !nls_strnicmp(nls_io, name, bufname, | 403 | (anycase && !nls_strnicmp(nls_io, name, bufname, |
@@ -406,8 +406,8 @@ parse_record: | |||
406 | 406 | ||
407 | if (nr_slots) { | 407 | if (nr_slots) { |
408 | xlate_len = utf8 | 408 | xlate_len = utf8 |
409 | ?utf8_wcstombs(bufname, unicode, PAGE_SIZE) | 409 | ?utf8_wcstombs(bufname, unicode, PATH_MAX) |
410 | :uni16_to_x8(bufname, unicode, PAGE_SIZE, uni_xlate, nls_io); | 410 | :uni16_to_x8(bufname, unicode, PATH_MAX, uni_xlate, nls_io); |
411 | if (xlate_len != name_len) | 411 | if (xlate_len != name_len) |
412 | continue; | 412 | continue; |
413 | if ((!anycase && !memcmp(name, bufname, xlate_len)) || | 413 | if ((!anycase && !memcmp(name, bufname, xlate_len)) || |
@@ -427,9 +427,9 @@ Found: | |||
427 | err = 0; | 427 | err = 0; |
428 | EODir: | 428 | EODir: |
429 | if (bufname) | 429 | if (bufname) |
430 | free_page((unsigned long)bufname); | 430 | __putname(bufname); |
431 | if (unicode) | 431 | if (unicode) |
432 | free_page((unsigned long)unicode); | 432 | __putname(unicode); |
433 | 433 | ||
434 | return err; | 434 | return err; |
435 | } | 435 | } |
@@ -619,7 +619,7 @@ parse_record: | |||
619 | /* convert the unicode long name. 261 is maximum size | 619 | /* convert the unicode long name. 261 is maximum size |
620 | * of unicode buffer. (13 * slots + nul) */ | 620 | * of unicode buffer. (13 * slots + nul) */ |
621 | void *longname = unicode + 261; | 621 | void *longname = unicode + 261; |
622 | int buf_size = PAGE_SIZE - (261 * sizeof(unicode[0])); | 622 | int buf_size = PATH_MAX - (261 * sizeof(unicode[0])); |
623 | int long_len = utf8 | 623 | int long_len = utf8 |
624 | ? utf8_wcstombs(longname, unicode, buf_size) | 624 | ? utf8_wcstombs(longname, unicode, buf_size) |
625 | : uni16_to_x8(longname, unicode, buf_size, uni_xlate, nls_io); | 625 | : uni16_to_x8(longname, unicode, buf_size, uni_xlate, nls_io); |
@@ -652,7 +652,7 @@ EODir: | |||
652 | FillFailed: | 652 | FillFailed: |
653 | brelse(bh); | 653 | brelse(bh); |
654 | if (unicode) | 654 | if (unicode) |
655 | free_page((unsigned long)unicode); | 655 | __putname(unicode); |
656 | out: | 656 | out: |
657 | unlock_kernel(); | 657 | unlock_kernel(); |
658 | return ret; | 658 | return ret; |