lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 16 Nov 2010 15:18:06 -0600
From:	Eric Sandeen <sandeen@...hat.com>
To:	Lukas Czerner <lczerner@...hat.com>
CC:	linux-ext4@...r.kernel.org, tytso@....edu, adilger@...ger.ca
Subject: Re: [PATCH 7/7] mke2fs: Use io_manager discard_zeroes_data property

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@...hat.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"));

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ