diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2007-10-15 11:29:05 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-25 03:07:16 -0500 |
commit | f91a0d3e24e4b0198be5fae20d45a35c40d1efce (patch) | |
tree | cda8095f9befd25cbfaf5f63a4c8ca26870d45ca /fs/gfs2/inode.c | |
parent | 3cc3f710ce0effe397b830826a1a081fa81f11c7 (diff) |
[GFS2] Remove useless i_cache from inodes
The i_cache was designed to keep references to the indirect blocks
used during block mapping so that they didn't have to be looked
up continually. The idea failed because there are too many places
where the i_cache needs to be freed, and this has in the past been
the cause of many bugs.
In addition there was no performance benefit being gained since the
disk blocks in question were cached anyway. So this patch removes
it in order to simplify the code to prepare for other changes which
would otherwise have had to add further support for this feature.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index ad0fe373dca5..af493fc6c8ce 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -293,11 +293,6 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) | |||
293 | return 0; | 293 | return 0; |
294 | } | 294 | } |
295 | 295 | ||
296 | static void gfs2_inode_bh(struct gfs2_inode *ip, struct buffer_head *bh) | ||
297 | { | ||
298 | ip->i_cache[0] = bh; | ||
299 | } | ||
300 | |||
301 | /** | 296 | /** |
302 | * gfs2_inode_refresh - Refresh the incore copy of the dinode | 297 | * gfs2_inode_refresh - Refresh the incore copy of the dinode |
303 | * @ip: The GFS2 inode | 298 | * @ip: The GFS2 inode |
@@ -965,7 +960,7 @@ struct inode *gfs2_createi(struct gfs2_holder *ghs, const struct qstr *name, | |||
965 | struct gfs2_inum_host inum = { .no_addr = 0, .no_formal_ino = 0 }; | 960 | struct gfs2_inum_host inum = { .no_addr = 0, .no_formal_ino = 0 }; |
966 | int error; | 961 | int error; |
967 | u64 generation; | 962 | u64 generation; |
968 | struct buffer_head *bh=NULL; | 963 | struct buffer_head *bh = NULL; |
969 | 964 | ||
970 | if (!name->len || name->len > GFS2_FNAMESIZE) | 965 | if (!name->len || name->len > GFS2_FNAMESIZE) |
971 | return ERR_PTR(-ENAMETOOLONG); | 966 | return ERR_PTR(-ENAMETOOLONG); |
@@ -1002,8 +997,6 @@ struct inode *gfs2_createi(struct gfs2_holder *ghs, const struct qstr *name, | |||
1002 | if (IS_ERR(inode)) | 997 | if (IS_ERR(inode)) |
1003 | goto fail_gunlock2; | 998 | goto fail_gunlock2; |
1004 | 999 | ||
1005 | gfs2_inode_bh(GFS2_I(inode), bh); | ||
1006 | |||
1007 | error = gfs2_inode_refresh(GFS2_I(inode)); | 1000 | error = gfs2_inode_refresh(GFS2_I(inode)); |
1008 | if (error) | 1001 | if (error) |
1009 | goto fail_gunlock2; | 1002 | goto fail_gunlock2; |
@@ -1020,6 +1013,8 @@ struct inode *gfs2_createi(struct gfs2_holder *ghs, const struct qstr *name, | |||
1020 | if (error) | 1013 | if (error) |
1021 | goto fail_gunlock2; | 1014 | goto fail_gunlock2; |
1022 | 1015 | ||
1016 | if (bh) | ||
1017 | brelse(bh); | ||
1023 | if (!inode) | 1018 | if (!inode) |
1024 | return ERR_PTR(-ENOMEM); | 1019 | return ERR_PTR(-ENOMEM); |
1025 | return inode; | 1020 | return inode; |
@@ -1031,6 +1026,8 @@ fail_gunlock2: | |||
1031 | fail_gunlock: | 1026 | fail_gunlock: |
1032 | gfs2_glock_dq(ghs); | 1027 | gfs2_glock_dq(ghs); |
1033 | fail: | 1028 | fail: |
1029 | if (bh) | ||
1030 | brelse(bh); | ||
1034 | return ERR_PTR(error); | 1031 | return ERR_PTR(error); |
1035 | } | 1032 | } |
1036 | 1033 | ||