From: Robin Dong <hao.bigrat@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: Robin Dong <hao.bigrat@gmail.com>, Robin Dong <sanbai@taobao.com>
Subject: [PATCH 3/3] ext4: modify the process of invalidate_page for the new implemention of quota reservation
Date: Tue, 13 Mar 2012 19:38:18 +0800 [thread overview]
Message-ID: <1331638698-14796-3-git-send-email-hao.bigrat@gmail.com> (raw)
In-Reply-To: <1331638698-14796-1-git-send-email-hao.bigrat@gmail.com>
Since buffer_head with PG_Delay does not means "quota already occupied" any more, we
should check whether to release reservation in ext4_da_invalidatepage.
Signed-off-by: Robin Dong <sanbai@taobao.com>
---
fs/ext4/inode.c | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 7e27581..e5d15eb 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1202,6 +1202,7 @@ static void ext4_da_page_release_reservation(struct page *page,
unsigned int curr_off = 0;
struct inode *inode = page->mapping->host;
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
+ struct ext4_map_blocks map;
int num_clusters;
head = page_buffers(page);
@@ -1220,15 +1221,21 @@ static void ext4_da_page_release_reservation(struct page *page,
/* If we have released all the blocks belonging to a cluster, then we
* need to release the reserved space for that cluster. */
num_clusters = EXT4_NUM_B2C(sbi, to_release);
- while (num_clusters > 0) {
- ext4_fsblk_t lblk;
- lblk = (page->index << (PAGE_CACHE_SHIFT - inode->i_blkbits)) +
- ((num_clusters - 1) << sbi->s_cluster_bits);
- if (sbi->s_cluster_ratio == 1 ||
- !ext4_find_delalloc_cluster(inode, lblk, 1))
- ext4_da_release_space(inode, 1);
next prev parent reply other threads:[~2012-03-13 11:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 11:38 [PATCH 1/3] ext4: s_freeclusters_counter should not tranform to unit of block before assigning to "free_clusters" in ext4_has_free_cluste Robin Dong
2012-03-13 11:38 ` [PATCH 2/3] ext4: modify the implementation of quota reservation in bigalloc-delay-allocation Robin Dong
2012-03-13 11:38 ` Robin Dong [this message]
2012-03-24 21:05 ` [PATCH 1/3] ext4: s_freeclusters_counter should not tranform to unit of block before assigning to "free_clusters" in ext4_has_free_cluste Ted Ts'o
2012-04-16 3:35 ` Robin Dong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331638698-14796-3-git-send-email-hao.bigrat@gmail.com \
--to=hao.bigrat@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sanbai@taobao.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).