diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-10 10:18:55 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-25 03:18:25 -0500 |
commit | 6dbd822487d0a9f14432cb4680415b80656b63a2 (patch) | |
tree | f0391d598c27cd7c39c67cfa13799a784f4c389a /fs/gfs2/dir.c | |
parent | ac39aadd0440ae696e6dacaa8006ce1737b17008 (diff) |
[GFS2] Reduce inode size by moving i_alloc out of line
It is possible to reduce the size of GFS2 inodes by taking the i_alloc
structure out of the gfs2_inode. This patch allocates the i_alloc
structure whenever its needed, and frees it afterward. This decreases
the amount of low memory we use at the expense of requiring a memory
allocation for each page or partial page that we write. A quick test
with postmark shows that the overhead is not measurable and I also note
that OCFS2 use the same approach.
In the future I'd like to solve the problem by shrinking down the size
of the members of the i_alloc structure, but for now, this reduces the
immediate problem of using too much low-memory on x86 and doesn't add
too much overhead.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/dir.c')
-rw-r--r-- | fs/gfs2/dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 9949bb746a52..57e2ed932adc 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -1876,7 +1876,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len, | |||
1876 | if (error) | 1876 | if (error) |
1877 | goto out; | 1877 | goto out; |
1878 | 1878 | ||
1879 | error = gfs2_rindex_hold(sdp, &dip->i_alloc.al_ri_gh); | 1879 | error = gfs2_rindex_hold(sdp, &dip->i_alloc->al_ri_gh); |
1880 | if (error) | 1880 | if (error) |
1881 | goto out_qs; | 1881 | goto out_qs; |
1882 | 1882 | ||
@@ -1949,7 +1949,7 @@ out_rg_gunlock: | |||
1949 | gfs2_glock_dq_m(rlist.rl_rgrps, rlist.rl_ghs); | 1949 | gfs2_glock_dq_m(rlist.rl_rgrps, rlist.rl_ghs); |
1950 | out_rlist: | 1950 | out_rlist: |
1951 | gfs2_rlist_free(&rlist); | 1951 | gfs2_rlist_free(&rlist); |
1952 | gfs2_glock_dq_uninit(&dip->i_alloc.al_ri_gh); | 1952 | gfs2_glock_dq_uninit(&dip->i_alloc->al_ri_gh); |
1953 | out_qs: | 1953 | out_qs: |
1954 | gfs2_quota_unhold(dip); | 1954 | gfs2_quota_unhold(dip); |
1955 | out: | 1955 | out: |