From: Eric Sandeen <sandeen@redhat.com>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, adilger@dilger.ca
Subject: Re: [PATCH 7/7] mke2fs: Use io_manager discard_zeroes_data property
Date: Tue, 16 Nov 2010 15:18:06 -0600 [thread overview]
Message-ID: <4CE2F50E.5010208@redhat.com> (raw)
In-Reply-To: <1288115658-7004-8-git-send-email-lczerner@redhat.com>
On 10/26/10 12:54 PM, Lukas Czerner wrote:
> We already have discard_zeroes_data variable in struct_io_manager
> structure, so we do nod need mke2fs_discard_zeroes_data() function
> anymore.
OK in spirit I think but I think you may need a new home for
discard_zeroes_data. :)
-Eric
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> ---
> misc/mke2fs.c | 27 +--------------------------
> 1 files changed, 1 insertions(+), 26 deletions(-)
>
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index 09ce711..114987c 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -1900,31 +1900,6 @@ static int mke2fs_setup_tdb(const char *name, io_manager *io_ptr)
> return retval;
> }
>
> -#ifdef __linux__
> -
> -#ifndef BLKDISCARDZEROES
> -#define BLKDISCARDZEROES _IO(0x12,124)
> -#endif
> -
> -static int mke2fs_discard_zeroes_data(ext2_filsys fs)
> -{
> - int fd;
> - int ret;
> - int discard_zeroes_data = 0;
> -
> - fd = open64(fs->device_name, O_RDWR);
> -
> - if (fd > 0) {
> - ioctl(fd, BLKDISCARDZEROES, &discard_zeroes_data);
> - close(fd);
> - }
> - return discard_zeroes_data;
> -}
> -#else
> -#define mke2fs_discard_blocks(fs) 1
> -#define mke2fs_discard_zeroes_data(fs) 0
> -#endif
> -
> int main (int argc, char *argv[])
> {
> errcode_t retval = 0;
> @@ -1997,7 +1972,7 @@ int main (int argc, char *argv[])
> printf(_("succeeded.\n"));
> }
>
> - if (!retval && mke2fs_discard_zeroes_data(fs)) {
> + if (!retval && io_ptr->discard_zeroes_data) {
> if (verbose)
> printf(_("Discard succeeded and will return 0s "
> " - skipping inode table wipe\n"));
prev parent reply other threads:[~2010-11-16 21:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-26 17:54 [PATCH 0/7] e2fsprogs: Using discard in e2fsprogs tools Lukas Czerner
2010-10-26 17:54 ` [PATCH 1/7] e2fsprogs: Add discard function into struct_io_manager Lukas Czerner
2010-11-16 18:28 ` Eric Sandeen
2010-11-16 20:16 ` Lukas Czerner
2010-11-16 21:09 ` Eric Sandeen
2010-11-18 9:52 ` Lukas Czerner
2010-10-26 17:54 ` [PATCH 2/7] e2fsprogs: Add discard_zeroes_data " Lukas Czerner
2010-11-16 18:46 ` Eric Sandeen
2010-10-26 17:54 ` [PATCH 3/7] e2fsck: Keep track of problems during the check Lukas Czerner
2010-11-16 20:03 ` Eric Sandeen
2010-10-26 17:54 ` [PATCH 4/7] e2fsck: Discard free data and inode blocks Lukas Czerner
2010-11-16 21:06 ` Eric Sandeen
2010-11-18 12:12 ` Lukas Czerner
2010-10-26 17:54 ` [PATCH 5/7] mke2fs: Change -K option to discard/nodiscard Lukas Czerner
2010-10-26 18:41 ` Eric Sandeen
2010-10-26 19:24 ` [PATCH 5/7] mke2fs: Deprecate -K option, introduce discard/nodiscard Lukas Czerner
2010-11-16 21:14 ` [PATCH 5/7] mke2fs: Change -K option to discard/nodiscard Eric Sandeen
2010-11-18 10:00 ` Lukas Czerner
2010-10-26 17:54 ` [PATCH 6/7] mke2fs: Use unix_discard() for discards Lukas Czerner
2010-11-16 21:17 ` Eric Sandeen
2010-10-26 17:54 ` [PATCH 7/7] mke2fs: Use io_manager discard_zeroes_data property Lukas Czerner
2010-11-16 21:18 ` Eric Sandeen [this message]
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=4CE2F50E.5010208@redhat.com \
--to=sandeen@redhat.com \
--cc=adilger@dilger.ca \
--cc=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).