aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-09-04 13:55:48 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-09-04 13:55:48 -0400
commitc26687113aea9a11c6f23ddf668f1fe43eca4ce7 (patch)
treee5cea81468e2b10e5c379a7c11fd56640d9c5c56 /fs
parentcd915493fce912f1bd838ee1250737ecf33b8fae (diff)
[GFS2] Remove a cast, tidy gfs2_inode_attr_in
The remains of the changes for Jan Engelhardt's third email. Remove a cast and tidy up gfs2_inode_attr_in. Cc: Jan Engelhardt <jengelh@linux01.gwdg.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/bmap.c2
-rw-r--r--fs/gfs2/inode.c27
2 files changed, 15 insertions, 14 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index a97ad74d880c..0f9567fe5c8b 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -344,7 +344,7 @@ static void find_metapath(struct gfs2_inode *ip, u64 block,
344 unsigned int i; 344 unsigned int i;
345 345
346 for (i = ip->i_di.di_height; i--;) 346 for (i = ip->i_di.di_height; i--;)
347 mp->mp_list[i] = (__u16)do_div(b, sdp->sd_inptrs); 347 mp->mp_list[i] = do_div(b, sdp->sd_inptrs);
348 348
349} 349}
350 350
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index f683a400b006..0d010f0654d9 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -47,40 +47,41 @@
47void gfs2_inode_attr_in(struct gfs2_inode *ip) 47void gfs2_inode_attr_in(struct gfs2_inode *ip)
48{ 48{
49 struct inode *inode = &ip->i_inode; 49 struct inode *inode = &ip->i_inode;
50 struct gfs2_dinode *di = &ip->i_di;
50 51
51 inode->i_ino = ip->i_num.no_addr; 52 inode->i_ino = ip->i_num.no_addr;
52 53
53 switch (ip->i_di.di_mode & S_IFMT) { 54 switch (di->di_mode & S_IFMT) {
54 case S_IFBLK: 55 case S_IFBLK:
55 case S_IFCHR: 56 case S_IFCHR:
56 inode->i_rdev = MKDEV(ip->i_di.di_major, ip->i_di.di_minor); 57 inode->i_rdev = MKDEV(di->di_major, di->di_minor);
57 break; 58 break;
58 default: 59 default:
59 inode->i_rdev = 0; 60 inode->i_rdev = 0;
60 break; 61 break;
61 }; 62 };
62 63
63 inode->i_mode = ip->i_di.di_mode; 64 inode->i_mode = di->di_mode;
64 inode->i_nlink = ip->i_di.di_nlink; 65 inode->i_nlink = di->di_nlink;
65 inode->i_uid = ip->i_di.di_uid; 66 inode->i_uid = di->di_uid;
66 inode->i_gid = ip->i_di.di_gid; 67 inode->i_gid = di->di_gid;
67 i_size_write(inode, ip->i_di.di_size); 68 i_size_write(inode, di->di_size);
68 inode->i_atime.tv_sec = ip->i_di.di_atime; 69 inode->i_atime.tv_sec = di->di_atime;
69 inode->i_mtime.tv_sec = ip->i_di.di_mtime; 70 inode->i_mtime.tv_sec = di->di_mtime;
70 inode->i_ctime.tv_sec = ip->i_di.di_ctime; 71 inode->i_ctime.tv_sec = di->di_ctime;
71 inode->i_atime.tv_nsec = 0; 72 inode->i_atime.tv_nsec = 0;
72 inode->i_mtime.tv_nsec = 0; 73 inode->i_mtime.tv_nsec = 0;
73 inode->i_ctime.tv_nsec = 0; 74 inode->i_ctime.tv_nsec = 0;
74 inode->i_blksize = PAGE_SIZE; 75 inode->i_blksize = PAGE_SIZE;
75 inode->i_blocks = ip->i_di.di_blocks << 76 inode->i_blocks = di->di_blocks <<
76 (GFS2_SB(inode)->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT); 77 (GFS2_SB(inode)->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT);
77 78
78 if (ip->i_di.di_flags & GFS2_DIF_IMMUTABLE) 79 if (di->di_flags & GFS2_DIF_IMMUTABLE)
79 inode->i_flags |= S_IMMUTABLE; 80 inode->i_flags |= S_IMMUTABLE;
80 else 81 else
81 inode->i_flags &= ~S_IMMUTABLE; 82 inode->i_flags &= ~S_IMMUTABLE;
82 83
83 if (ip->i_di.di_flags & GFS2_DIF_APPENDONLY) 84 if (di->di_flags & GFS2_DIF_APPENDONLY)
84 inode->i_flags |= S_APPEND; 85 inode->i_flags |= S_APPEND;
85 else 86 else
86 inode->i_flags &= ~S_APPEND; 87 inode->i_flags &= ~S_APPEND;