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/ops_inode.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/ops_inode.c')
-rw-r--r-- | fs/gfs2/ops_inode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index 8386ab323e33..9f71372c1757 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c | |||
@@ -61,7 +61,7 @@ static int gfs2_create(struct inode *dir, struct dentry *dentry, | |||
61 | inode = gfs2_createi(ghs, &dentry->d_name, S_IFREG | mode, 0); | 61 | inode = gfs2_createi(ghs, &dentry->d_name, S_IFREG | mode, 0); |
62 | if (!IS_ERR(inode)) { | 62 | if (!IS_ERR(inode)) { |
63 | gfs2_trans_end(sdp); | 63 | gfs2_trans_end(sdp); |
64 | if (dip->i_alloc.al_rgd) | 64 | if (dip->i_alloc->al_rgd) |
65 | gfs2_inplace_release(dip); | 65 | gfs2_inplace_release(dip); |
66 | gfs2_quota_unlock(dip); | 66 | gfs2_quota_unlock(dip); |
67 | gfs2_alloc_put(dip); | 67 | gfs2_alloc_put(dip); |
@@ -376,7 +376,7 @@ static int gfs2_symlink(struct inode *dir, struct dentry *dentry, | |||
376 | } | 376 | } |
377 | 377 | ||
378 | gfs2_trans_end(sdp); | 378 | gfs2_trans_end(sdp); |
379 | if (dip->i_alloc.al_rgd) | 379 | if (dip->i_alloc->al_rgd) |
380 | gfs2_inplace_release(dip); | 380 | gfs2_inplace_release(dip); |
381 | gfs2_quota_unlock(dip); | 381 | gfs2_quota_unlock(dip); |
382 | gfs2_alloc_put(dip); | 382 | gfs2_alloc_put(dip); |
@@ -452,7 +452,7 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
452 | gfs2_assert_withdraw(sdp, !error); /* dip already pinned */ | 452 | gfs2_assert_withdraw(sdp, !error); /* dip already pinned */ |
453 | 453 | ||
454 | gfs2_trans_end(sdp); | 454 | gfs2_trans_end(sdp); |
455 | if (dip->i_alloc.al_rgd) | 455 | if (dip->i_alloc->al_rgd) |
456 | gfs2_inplace_release(dip); | 456 | gfs2_inplace_release(dip); |
457 | gfs2_quota_unlock(dip); | 457 | gfs2_quota_unlock(dip); |
458 | gfs2_alloc_put(dip); | 458 | gfs2_alloc_put(dip); |
@@ -558,7 +558,7 @@ static int gfs2_mknod(struct inode *dir, struct dentry *dentry, int mode, | |||
558 | } | 558 | } |
559 | 559 | ||
560 | gfs2_trans_end(sdp); | 560 | gfs2_trans_end(sdp); |
561 | if (dip->i_alloc.al_rgd) | 561 | if (dip->i_alloc->al_rgd) |
562 | gfs2_inplace_release(dip); | 562 | gfs2_inplace_release(dip); |
563 | gfs2_quota_unlock(dip); | 563 | gfs2_quota_unlock(dip); |
564 | gfs2_alloc_put(dip); | 564 | gfs2_alloc_put(dip); |