Re: [PATCH 1/4] xfstests: if DEV_BSIZE is not defined, assume it to be 512

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Mon, Jul 27, 2015 at 10:22:44AM -0400, Theodore Ts'o wrote:
> On Linux systems with glibc, DEV_BSIZE defines the sector size for the
> Linux kernel, which is 512 since the beginning of time --- and which
> we can't really change without breaking a huge amount of kernel code.
> Some non-glibc C libraries, may not define DEV_BSIZE; if it does not
> exist, assume that it will be 512.
> 
> Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
> ---
>  lib/str_to_bytes.c | 4 ++++
>  lib/write_log.c    | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/lib/str_to_bytes.c b/lib/str_to_bytes.c
> index c0d7d97..d63e93b 100644
> --- a/lib/str_to_bytes.c
> +++ b/lib/str_to_bytes.c
> @@ -44,7 +44,11 @@
>   ****************************************************************************/
>  
>  #if linux
> +#ifdef DEV_BSIZE
>  #define B_MULT	DEV_BSIZE	/* block size */
> +#else
> +#define B_MULT	512		/* block size */
> +#endif
>  #endif

That ifdef Linux looks bogus too.  I's say just define it to 512
bytes here unconditionally.

>  #ifndef BSIZE
>  #ifdef linux
> +#ifdef DEV_BSIZE
>  #define BSIZE DEV_BSIZE
> +#else  /* !DEV_BSIZE */
> +#define BSIZE 512
> +#endif	/* DEV_BSIZE */
>  #else
>  #define BSIZE BBSIZE
>  #endif

Same here, drop all the ifdefs and just define it to 512.
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux