From: Guo Chao <yan@linux.vnet.ibm.com>
To: Zheng Liu <gnehzuil.liu@gmail.com>
Cc: linux-ext4@vger.kernel.org, Zheng Liu <wenqing.lz@taobao.com>
Subject: Re: [PATCH 2/3 v2] ext4: let us fully support punching hole feature in fallocate
Date: Tue, 20 Nov 2012 14:35:05 +0800 [thread overview]
Message-ID: <20121120063505.GA11117@yanx> (raw)
In-Reply-To: <1353329718-2075-3-git-send-email-wenqing.lz@taobao.com>
Hi, Zheng:
On Mon, Nov 19, 2012 at 08:55:17PM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
>
> After adding indirect punching hole feature, we need to enable it in fallocate.
> For this purpose, some sanity checks need to be adjusted. Currently we need to
> check FALLOC_FL_PUNCH_HOLE flag before other sanity checks.
>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> ---
> fs/ext4/extents.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 7011ac9..b43b3e9 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -4420,13 +4420,6 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
> struct ext4_map_blocks map;
> unsigned int credits, blkbits = inode->i_blkbits;
>
> - /*
> - * currently supporting (pre)allocate mode for extent-based
> - * files _only_
> - */
> - if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
> - return -EOPNOTSUPP;
> -
> /* Return error if mode is not supported */
> if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
> return -EOPNOTSUPP;
Checking these mode flags seems redundant here, VFS already checked them.
Maybe you can remove it by the way.
Regards,
Guo Chao
next prev parent reply other threads:[~2012-11-20 6:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-19 12:55 [PATCH 0/3 v2] ext4: punching hole improvement Zheng Liu
2012-11-19 12:55 ` [PATCH 1/3 v2] ext4: add indirect punching hole support Zheng Liu
2012-11-19 12:55 ` [PATCH 2/3 v2] ext4: let us fully support punching hole feature in fallocate Zheng Liu
2012-11-20 6:35 ` Guo Chao [this message]
2012-11-20 7:43 ` Zheng Liu
2012-11-19 12:55 ` [PATCH 3/3 v2] ext4: add tracepoint for punching hole Zheng Liu
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=20121120063505.GA11117@yanx \
--to=yan@linux.vnet.ibm.com \
--cc=gnehzuil.liu@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=wenqing.lz@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).