From: Lukas Czerner <lczerner@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, lczerner@redhat.com
Subject: [PATCH 2/2] ext4: Adjust mineln with discard_granularity in FITRIM code
Date: Tue, 15 Feb 2011 18:06:25 +0100 [thread overview]
Message-ID: <1297789585-5986-2-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1297789585-5986-1-git-send-email-lczerner@redhat.com>
Discard granularity tells us the minimum size of extent to be discarded.
Use that information to adjust minlen properly in FITRIM code. Smaller
extents will be ignored anyway, so we can optimize by not even trying to
discard them.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
fs/ext4/ioctl.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 25ba7c7..c052c9f 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -348,6 +348,8 @@ mext_out:
sizeof(range)))
return -EFAULT;
+ range.minlen = max((unsigned int)range.minlen,
+ q->limits.discard_granularity);
ret = ext4_trim_fs(sb, &range);
if (ret < 0)
return ret;
--
1.7.4
next prev parent reply other threads:[~2011-02-15 17:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-15 17:06 [PATCH 1/2] ext4: check if device support discard in FITRIM ioctl Lukas Czerner
2011-02-15 17:06 ` Lukas Czerner [this message]
2011-02-23 17:58 ` [PATCH 2/2] ext4: Adjust mineln with discard_granularity in FITRIM code Ted Ts'o
2011-02-23 18:19 ` Lukas Czerner
2011-02-23 17:50 ` [PATCH 1/2] ext4: check if device support discard in FITRIM ioctl Ted Ts'o
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=1297789585-5986-2-git-send-email-lczerner@redhat.com \
--to=lczerner@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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).