Skip to content

Commit c99b684

Browse files
Wei Yongjuntorvalds
authored andcommitted
omfs: convert to use beXX_add_cpu()
Convert cpu_to_beXX(beXX_to_cpu(E1) + E2) to use beXX_add_cpu(). dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0324b5a commit c99b684

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎fs/omfs/file.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
146146
be64_to_cpu(entry->e_blocks);
147147

148148
if (omfs_allocate_block(inode->i_sb, new_block)) {
149-
entry->e_blocks =
150-
cpu_to_be64(be64_to_cpu(entry->e_blocks) + 1);
149+
be64_add_cpu(&entry->e_blocks, 1);
151150
terminator->e_blocks = ~(cpu_to_be64(
152151
be64_to_cpu(~terminator->e_blocks) + 1));
153152
goto out;
@@ -177,7 +176,7 @@ static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
177176
be64_to_cpu(~terminator->e_blocks) + (u64) new_count));
178177

179178
/* write in new entry */
180-
oe->e_extent_count = cpu_to_be32(1 + be32_to_cpu(oe->e_extent_count));
179+
be32_add_cpu(&oe->e_extent_count, 1);
181180

182181
out:
183182
*ret_block = new_block;

0 commit comments

Comments
 (0)