aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-11-08 15:45:46 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-30 10:34:52 -0500
commit9e2dbdac3df300516ffdd9a8631f23164d068a50 (patch)
tree088a7dce1a0cc678a80ca1609642e7e3ecacd4dd /fs/gfs2/inode.c
parente7c698d74fc9e0e76b3086062b0519df3601ff52 (diff)
[GFS2] Remove gfs2_inode_attr_in
This function wasn't really doing the right thing. There was no need to update the inode size at this point and the updating of the i_blocks field has now been moved to the places where di_blocks is updated. A result of this patch and some those preceeding it is that unlocking a glock is now a much more efficient process, since there is no longer any requirement to copy data from the gfs2 inode into the vfs inode at this point. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 19b2736cd52f..ea9ca239c878 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -38,29 +38,12 @@
38#include "trans.h" 38#include "trans.h"
39#include "util.h" 39#include "util.h"
40 40
41/**
42 * gfs2_inode_attr_in - Copy attributes from the dinode into the VFS inode
43 * @ip: The GFS2 inode (with embedded disk inode data)
44 * @inode: The Linux VFS inode
45 *
46 */
47
48void gfs2_inode_attr_in(struct gfs2_inode *ip)
49{
50 struct inode *inode = &ip->i_inode;
51 struct gfs2_dinode_host *di = &ip->i_di;
52
53 i_size_write(inode, di->di_size);
54 inode->i_blocks = di->di_blocks <<
55 (GFS2_SB(inode)->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT);
56}
57
58static int iget_test(struct inode *inode, void *opaque) 41static int iget_test(struct inode *inode, void *opaque)
59{ 42{
60 struct gfs2_inode *ip = GFS2_I(inode); 43 struct gfs2_inode *ip = GFS2_I(inode);
61 struct gfs2_inum_host *inum = opaque; 44 struct gfs2_inum_host *inum = opaque;
62 45
63 if (ip && ip->i_num.no_addr == inum->no_addr) 46 if (ip->i_num.no_addr == inum->no_addr)
64 return 1; 47 return 1;
65 48
66 return 0; 49 return 0;
@@ -187,7 +170,9 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
187 */ 170 */
188 ip->i_inode.i_nlink = be32_to_cpu(str->di_nlink); 171 ip->i_inode.i_nlink = be32_to_cpu(str->di_nlink);
189 di->di_size = be64_to_cpu(str->di_size); 172 di->di_size = be64_to_cpu(str->di_size);
173 i_size_write(&ip->i_inode, di->di_size);
190 di->di_blocks = be64_to_cpu(str->di_blocks); 174 di->di_blocks = be64_to_cpu(str->di_blocks);
175 gfs2_set_inode_blocks(&ip->i_inode);
191 ip->i_inode.i_atime.tv_sec = be64_to_cpu(str->di_atime); 176 ip->i_inode.i_atime.tv_sec = be64_to_cpu(str->di_atime);
192 ip->i_inode.i_atime.tv_nsec = 0; 177 ip->i_inode.i_atime.tv_nsec = 0;
193 ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime); 178 ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime);