[PATCH] gfs2: be*_add_cpu conversion

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: marcin.slusarz
Date: Tuesday, February 12, 2008 - 4:06 pm

From: Marcin Slusarz <marcin.slusarz@gmail.com>

replace all:
big_endian_variable = cpu_to_beX(beX_to_cpu(big_endian_variable) +
					expression_in_cpu_byteorder);
with:
	beX_add_cpu(&big_endian_variable, expression_in_cpu_byteorder);
generated with semantic patch

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: cluster-devel@redhat.com
---
 fs/gfs2/dir.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index c347095..6f2e382 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -1021,13 +1021,13 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name)
 
 			new->de_inum = dent->de_inum; /* No endian worries */
 			new->de_type = dent->de_type; /* No endian worries */
-			nleaf->lf_entries = cpu_to_be16(be16_to_cpu(nleaf->lf_entries)+1);
+			be16_add_cpu(&nleaf->lf_entries, 1);
 
 			dirent_del(dip, obh, prev, dent);
 
 			if (!oleaf->lf_entries)
 				gfs2_consist_inode(dip);
-			oleaf->lf_entries = cpu_to_be16(be16_to_cpu(oleaf->lf_entries)-1);
+			be16_add_cpu(&oleaf->lf_entries, -1);
 
 			if (!prev)
 				prev = dent;
@@ -1616,7 +1616,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name,
 			dent->de_type = cpu_to_be16(type);
 			if (ip->i_di.di_flags & GFS2_DIF_EXHASH) {
 				leaf = (struct gfs2_leaf *)bh->b_data;
-				leaf->lf_entries = cpu_to_be16(be16_to_cpu(leaf->lf_entries) + 1);
+				be16_add_cpu(&leaf->lf_entries, 1);
 			}
 			brelse(bh);
 			error = gfs2_meta_inode_buffer(ip, &bh);
-- 
1.5.3.7

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCHSET] [bl]e*_add_cpu conversions, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] crypto: be*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] ieee 1394: be*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] infiniband: be*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] affs: be*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] gfs2: be*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] hfs/hfsplus: be*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] ipw2200: le*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] scsi: le*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] ext2: le*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] ext4: le*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] jfs: le*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] ntfs: le*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] ocfs2: le*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] quota: le*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] reiserfs: le*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] sysv: [bl]e*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
[PATCH] ufs: [bl]e*_add_cpu conversion, marcin.slusarz, (Tue Feb 12, 4:06 pm)
Re: [PATCH] infiniband: be*_add_cpu conversion, Roland Dreier, (Tue Feb 12, 5:32 pm)
Re: [PATCH] crypto: be*_add_cpu conversion, Roel Kluin, (Wed Feb 13, 1:25 am)
Re: [PATCH] ufs: [bl]e*_add_cpu conversion, Roel Kluin, (Wed Feb 13, 2:41 am)
Re: [PATCH] quota: le*_add_cpu conversion, Jan Kara, (Wed Feb 13, 2:52 am)
Re: [PATCH] gfs2: be*_add_cpu conversion, Steven Whitehouse, (Wed Feb 13, 2:55 am)
RE: [PATCH] scsi: le*_add_cpu conversion, Salyzyn, Mark, (Wed Feb 13, 7:06 am)
RE: [PATCH] ipw2200: le*_add_cpu conversion, Chatre, Reinette, (Wed Feb 13, 9:54 am)
Re: [PATCH] ufs: [bl]e*_add_cpu conversion, Marcin Slusarz, (Wed Feb 13, 11:21 am)
Re: [PATCH] crypto: be*_add_cpu conversion, Marcin Slusarz, (Wed Feb 13, 11:36 am)
Re: [PATCH] jfs: le*_add_cpu conversion, Dave Kleikamp, (Wed Feb 13, 2:51 pm)
Re: [PATCH] sysv: [bl]e*_add_cpu conversion, Christoph Hellwig, (Thu Feb 14, 12:04 am)
Re: [PATCH] ufs: [bl]e*_add_cpu conversion, Andrew Morton, (Fri Feb 15, 10:28 pm)
Re: [PATCH] sysv: [bl]e*_add_cpu conversion, Christoph Hellwig, (Sat Feb 16, 6:31 am)
Re: [PATCH] ieee 1394: be*_add_cpu conversion, Stefan Richter, (Sat Feb 16, 9:54 am)
Re: [PATCH] ocfs2: le*_add_cpu conversion, Mark Fasheh, (Mon Feb 18, 2:03 pm)
Re: [PATCH] ufs: [bl]e*_add_cpu conversion, Roel Kluin, (Mon Feb 18, 4:22 pm)
Re: [PATCH] ufs: [bl]e*_add_cpu conversion, Marcin Slusarz, (Tue Feb 19, 10:45 am)
Re: [PATCH] ufs: [bl]e*_add_cpu conversion, Evgeniy Dushistov, (Tue Feb 19, 12:16 pm)
Re: [PATCH] ufs: [bl]e*_add_cpu conversion, Marcin Slusarz, (Sun Mar 9, 3:21 am)
Re: [PATCH] crypto: be*_add_cpu conversion, Herbert Xu, (Fri Mar 14, 1:24 am)