aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-04-28 05:15:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:43 -0400
commitfba4d3997f4c3dc6de927f7f516168580033ae1a (patch)
tree296923be4f914ebd4500cba94fad091bf01c15c8 /fs
parent1e3832b0b1518232f47d89bc9d1f68e151a749ff (diff)
ext2: le*_add_cpu conversion
replace all: little_endian_variable = cpu_to_leX(leX_to_cpu(little_endian_variable) + expression_in_cpu_byteorder); with: leX_add_cpu(&little_endian_variable, expression_in_cpu_byteorder); generated with semantic patch Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext2/ialloc.c12
-rw-r--r--fs/ext2/super.c2
-rw-r--r--fs/ext2/xattr.c9
3 files changed, 8 insertions, 15 deletions
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index 08f647d8188d..f59741346760 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -75,11 +75,9 @@ static void ext2_release_inode(struct super_block *sb, int group, int dir)
75 } 75 }
76 76
77 spin_lock(sb_bgl_lock(EXT2_SB(sb), group)); 77 spin_lock(sb_bgl_lock(EXT2_SB(sb), group));
78 desc->bg_free_inodes_count = 78 le16_add_cpu(&desc->bg_free_inodes_count, 1);
79 cpu_to_le16(le16_to_cpu(desc->bg_free_inodes_count) + 1);
80 if (dir) 79 if (dir)
81 desc->bg_used_dirs_count = 80 le16_add_cpu(&desc->bg_used_dirs_count, -1);
82 cpu_to_le16(le16_to_cpu(desc->bg_used_dirs_count) - 1);
83 spin_unlock(sb_bgl_lock(EXT2_SB(sb), group)); 81 spin_unlock(sb_bgl_lock(EXT2_SB(sb), group));
84 if (dir) 82 if (dir)
85 percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter); 83 percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter);
@@ -539,13 +537,11 @@ got:
539 percpu_counter_inc(&sbi->s_dirs_counter); 537 percpu_counter_inc(&sbi->s_dirs_counter);
540 538
541 spin_lock(sb_bgl_lock(sbi, group)); 539 spin_lock(sb_bgl_lock(sbi, group));
542 gdp->bg_free_inodes_count = 540 le16_add_cpu(&gdp->bg_free_inodes_count, -1);
543 cpu_to_le16(le16_to_cpu(gdp->bg_free_inodes_count) - 1);
544 if (S_ISDIR(mode)) { 541 if (S_ISDIR(mode)) {
545 if (sbi->s_debts[group] < 255) 542 if (sbi->s_debts[group] < 255)
546 sbi->s_debts[group]++; 543 sbi->s_debts[group]++;
547 gdp->bg_used_dirs_count = 544 le16_add_cpu(&gdp->bg_used_dirs_count, 1);
548 cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) + 1);
549 } else { 545 } else {
550 if (sbi->s_debts[group]) 546 if (sbi->s_debts[group])
551 sbi->s_debts[group]--; 547 sbi->s_debts[group]--;
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 088b011bb97e..40d934c3e403 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -604,7 +604,7 @@ static int ext2_setup_super (struct super_block * sb,
604 "running e2fsck is recommended\n"); 604 "running e2fsck is recommended\n");
605 if (!le16_to_cpu(es->s_max_mnt_count)) 605 if (!le16_to_cpu(es->s_max_mnt_count))
606 es->s_max_mnt_count = cpu_to_le16(EXT2_DFL_MAX_MNT_COUNT); 606 es->s_max_mnt_count = cpu_to_le16(EXT2_DFL_MAX_MNT_COUNT);
607 es->s_mnt_count=cpu_to_le16(le16_to_cpu(es->s_mnt_count) + 1); 607 le16_add_cpu(&es->s_mnt_count, 1);
608 ext2_write_super(sb); 608 ext2_write_super(sb);
609 if (test_opt (sb, DEBUG)) 609 if (test_opt (sb, DEBUG))
610 printk ("[EXT II FS %s, %s, bs=%lu, fs=%lu, gc=%lu, " 610 printk ("[EXT II FS %s, %s, bs=%lu, fs=%lu, gc=%lu, "
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index a99d46f3b26e..b86f02747eaf 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -646,8 +646,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
646 unlock_buffer(new_bh); 646 unlock_buffer(new_bh);
647 goto cleanup; 647 goto cleanup;
648 } 648 }
649 HDR(new_bh)->h_refcount = cpu_to_le32(1 + 649 le32_add_cpu(&HDR(new_bh)->h_refcount, 1);
650 le32_to_cpu(HDR(new_bh)->h_refcount));
651 ea_bdebug(new_bh, "refcount now=%d", 650 ea_bdebug(new_bh, "refcount now=%d",
652 le32_to_cpu(HDR(new_bh)->h_refcount)); 651 le32_to_cpu(HDR(new_bh)->h_refcount));
653 } 652 }
@@ -731,8 +730,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
731 bforget(old_bh); 730 bforget(old_bh);
732 } else { 731 } else {
733 /* Decrement the refcount only. */ 732 /* Decrement the refcount only. */
734 HDR(old_bh)->h_refcount = cpu_to_le32( 733 le32_add_cpu(&HDR(old_bh)->h_refcount, -1);
735 le32_to_cpu(HDR(old_bh)->h_refcount) - 1);
736 if (ce) 734 if (ce)
737 mb_cache_entry_release(ce); 735 mb_cache_entry_release(ce);
738 DQUOT_FREE_BLOCK(inode, 1); 736 DQUOT_FREE_BLOCK(inode, 1);
@@ -789,8 +787,7 @@ ext2_xattr_delete_inode(struct inode *inode)
789 bforget(bh); 787 bforget(bh);
790 unlock_buffer(bh); 788 unlock_buffer(bh);
791 } else { 789 } else {
792 HDR(bh)->h_refcount = cpu_to_le32( 790 le32_add_cpu(&HDR(bh)->h_refcount, -1);
793 le32_to_cpu(HDR(bh)->h_refcount) - 1);
794 if (ce) 791 if (ce)
795 mb_cache_entry_release(ce); 792 mb_cache_entry_release(ce);
796 ea_bdebug(bh, "refcount now=%d", 793 ea_bdebug(bh, "refcount now=%d",