From 48516ced21e83a755ebae3d1ed03f1731befc391 Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Mon, 2 Oct 2006 12:39:19 -0400 Subject: [GFS2] Remove uneeded endian conversion In many places GFS2 was calling the endian conversion routines for an inode even when only a single field, or a few fields might have changed. As a result we were copying lots of data needlessly. This patch replaces those calls with conversion of just the required fields in each case. This should be faster and easier to understand. There are still other places which suffer from this problem, but this is a start in the right direction. Signed-off-by: Steven Whitehouse --- fs/gfs2/inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/gfs2/inode.c') diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 57a4c8b68587..660dc81849a6 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -1166,6 +1166,7 @@ int gfs2_glock_nq_atime(struct gfs2_holder *gh) curtime = get_seconds(); if (curtime - ip->i_di.di_atime >= quantum) { struct buffer_head *dibh; + struct gfs2_dinode *di; error = gfs2_trans_begin(sdp, RES_DINODE, 0); if (error == -EROFS) @@ -1180,7 +1181,8 @@ int gfs2_glock_nq_atime(struct gfs2_holder *gh) ip->i_di.di_atime = curtime; gfs2_trans_add_bh(ip->i_gl, dibh, 1); - gfs2_dinode_out(&ip->i_di, dibh->b_data); + di = (struct gfs2_dinode *)dibh->b_data; + di->di_atime = cpu_to_be64(ip->i_di.di_atime); brelse(dibh); gfs2_trans_end(sdp); -- cgit v1.2.3