diff options
Diffstat (limited to 'fs/reiserfs/namei.c')
-rw-r--r-- | fs/reiserfs/namei.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 8f8d8d01107c..284f7852de8b 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -247,7 +247,7 @@ static int linear_search_in_dir_item(struct cpu_key *key, | |||
247 | /* mark, that this generation number is used */ | 247 | /* mark, that this generation number is used */ |
248 | if (de->de_gen_number_bit_string) | 248 | if (de->de_gen_number_bit_string) |
249 | set_bit(GET_GENERATION_NUMBER(deh_offset(deh)), | 249 | set_bit(GET_GENERATION_NUMBER(deh_offset(deh)), |
250 | (unsigned long *)de->de_gen_number_bit_string); | 250 | de->de_gen_number_bit_string); |
251 | 251 | ||
252 | // calculate pointer to name and namelen | 252 | // calculate pointer to name and namelen |
253 | de->de_entry_num = i; | 253 | de->de_entry_num = i; |
@@ -431,7 +431,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, | |||
431 | struct reiserfs_de_head *deh; | 431 | struct reiserfs_de_head *deh; |
432 | INITIALIZE_PATH(path); | 432 | INITIALIZE_PATH(path); |
433 | struct reiserfs_dir_entry de; | 433 | struct reiserfs_dir_entry de; |
434 | int bit_string[MAX_GENERATION_NUMBER / (sizeof(int) * 8) + 1]; | 434 | DECLARE_BITMAP(bit_string, MAX_GENERATION_NUMBER + 1); |
435 | int gen_number; | 435 | int gen_number; |
436 | char small_buf[32 + DEH_SIZE]; /* 48 bytes now and we avoid kmalloc | 436 | char small_buf[32 + DEH_SIZE]; /* 48 bytes now and we avoid kmalloc |
437 | if we create file with short name */ | 437 | if we create file with short name */ |
@@ -456,7 +456,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, | |||
456 | /* get memory for composing the entry */ | 456 | /* get memory for composing the entry */ |
457 | buflen = DEH_SIZE + ROUND_UP(namelen); | 457 | buflen = DEH_SIZE + ROUND_UP(namelen); |
458 | if (buflen > sizeof(small_buf)) { | 458 | if (buflen > sizeof(small_buf)) { |
459 | buffer = reiserfs_kmalloc(buflen, GFP_NOFS, dir->i_sb); | 459 | buffer = kmalloc(buflen, GFP_NOFS); |
460 | if (buffer == 0) | 460 | if (buffer == 0) |
461 | return -ENOMEM; | 461 | return -ENOMEM; |
462 | } else | 462 | } else |
@@ -486,11 +486,11 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, | |||
486 | 486 | ||
487 | /* find the proper place for the new entry */ | 487 | /* find the proper place for the new entry */ |
488 | memset(bit_string, 0, sizeof(bit_string)); | 488 | memset(bit_string, 0, sizeof(bit_string)); |
489 | de.de_gen_number_bit_string = (char *)bit_string; | 489 | de.de_gen_number_bit_string = bit_string; |
490 | retval = reiserfs_find_entry(dir, name, namelen, &path, &de); | 490 | retval = reiserfs_find_entry(dir, name, namelen, &path, &de); |
491 | if (retval != NAME_NOT_FOUND) { | 491 | if (retval != NAME_NOT_FOUND) { |
492 | if (buffer != small_buf) | 492 | if (buffer != small_buf) |
493 | reiserfs_kfree(buffer, buflen, dir->i_sb); | 493 | kfree(buffer); |
494 | pathrelse(&path); | 494 | pathrelse(&path); |
495 | 495 | ||
496 | if (retval == IO_ERROR) { | 496 | if (retval == IO_ERROR) { |
@@ -508,14 +508,14 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, | |||
508 | } | 508 | } |
509 | 509 | ||
510 | gen_number = | 510 | gen_number = |
511 | find_first_zero_bit((unsigned long *)bit_string, | 511 | find_first_zero_bit(bit_string, |
512 | MAX_GENERATION_NUMBER + 1); | 512 | MAX_GENERATION_NUMBER + 1); |
513 | if (gen_number > MAX_GENERATION_NUMBER) { | 513 | if (gen_number > MAX_GENERATION_NUMBER) { |
514 | /* there is no free generation number */ | 514 | /* there is no free generation number */ |
515 | reiserfs_warning(dir->i_sb, | 515 | reiserfs_warning(dir->i_sb, |
516 | "reiserfs_add_entry: Congratulations! we have got hash function screwed up"); | 516 | "reiserfs_add_entry: Congratulations! we have got hash function screwed up"); |
517 | if (buffer != small_buf) | 517 | if (buffer != small_buf) |
518 | reiserfs_kfree(buffer, buflen, dir->i_sb); | 518 | kfree(buffer); |
519 | pathrelse(&path); | 519 | pathrelse(&path); |
520 | return -EBUSY; | 520 | return -EBUSY; |
521 | } | 521 | } |
@@ -535,7 +535,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, | |||
535 | &entry_key); | 535 | &entry_key); |
536 | 536 | ||
537 | if (buffer != small_buf) | 537 | if (buffer != small_buf) |
538 | reiserfs_kfree(buffer, buflen, dir->i_sb); | 538 | kfree(buffer); |
539 | pathrelse(&path); | 539 | pathrelse(&path); |
540 | return -EBUSY; | 540 | return -EBUSY; |
541 | } | 541 | } |
@@ -546,7 +546,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, | |||
546 | reiserfs_paste_into_item(th, &path, &entry_key, dir, buffer, | 546 | reiserfs_paste_into_item(th, &path, &entry_key, dir, buffer, |
547 | paste_size); | 547 | paste_size); |
548 | if (buffer != small_buf) | 548 | if (buffer != small_buf) |
549 | reiserfs_kfree(buffer, buflen, dir->i_sb); | 549 | kfree(buffer); |
550 | if (retval) { | 550 | if (retval) { |
551 | reiserfs_check_path(&path); | 551 | reiserfs_check_path(&path); |
552 | return retval; | 552 | return retval; |
@@ -1065,7 +1065,7 @@ static int reiserfs_symlink(struct inode *parent_dir, | |||
1065 | goto out_failed; | 1065 | goto out_failed; |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | name = reiserfs_kmalloc(item_len, GFP_NOFS, parent_dir->i_sb); | 1068 | name = kmalloc(item_len, GFP_NOFS); |
1069 | if (!name) { | 1069 | if (!name) { |
1070 | drop_new_inode(inode); | 1070 | drop_new_inode(inode); |
1071 | retval = -ENOMEM; | 1071 | retval = -ENOMEM; |
@@ -1079,14 +1079,14 @@ static int reiserfs_symlink(struct inode *parent_dir, | |||
1079 | retval = journal_begin(&th, parent_dir->i_sb, jbegin_count); | 1079 | retval = journal_begin(&th, parent_dir->i_sb, jbegin_count); |
1080 | if (retval) { | 1080 | if (retval) { |
1081 | drop_new_inode(inode); | 1081 | drop_new_inode(inode); |
1082 | reiserfs_kfree(name, item_len, parent_dir->i_sb); | 1082 | kfree(name); |
1083 | goto out_failed; | 1083 | goto out_failed; |
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | retval = | 1086 | retval = |
1087 | reiserfs_new_inode(&th, parent_dir, mode, name, strlen(symname), | 1087 | reiserfs_new_inode(&th, parent_dir, mode, name, strlen(symname), |
1088 | dentry, inode); | 1088 | dentry, inode); |
1089 | reiserfs_kfree(name, item_len, parent_dir->i_sb); | 1089 | kfree(name); |
1090 | if (retval) { /* reiserfs_new_inode iputs for us */ | 1090 | if (retval) { /* reiserfs_new_inode iputs for us */ |
1091 | goto out_failed; | 1091 | goto out_failed; |
1092 | } | 1092 | } |