All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH 1/4] xfstests: if DEV_BSIZE is not defined, assume it to be 512
Date: Thu, 30 Jul 2015 10:13:58 -0700	[thread overview]
Message-ID: <20150730171358.GA18185@infradead.org> (raw)
In-Reply-To: <1438006967-18815-2-git-send-email-tytso@mit.edu>

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@mit.edu>
> ---
>  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.

  reply	other threads:[~2015-07-30 17:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 14:22 [PATCH 0/4] xfstests portability fixes for Android Theodore Ts'o
2015-07-27 14:22 ` [PATCH 1/4] xfstests: if DEV_BSIZE is not defined, assume it to be 512 Theodore Ts'o
2015-07-30 17:13   ` Christoph Hellwig [this message]
2015-07-30 17:47     ` Theodore Ts'o
2015-07-27 14:22 ` [PATCH 2/4] xfstests: Support C libraries that define SIGCHLD instead of SIGCLD Theodore Ts'o
2015-07-30 17:14   ` Christoph Hellwig
2015-07-30 17:47     ` Theodore Ts'o
2015-07-27 14:22 ` [PATCH 3/4] xfstests: use the Posix st_mode defines instead of the obsolete SysV ones Theodore Ts'o
2015-07-30 17:14   ` Christoph Hellwig
2015-07-27 14:22 ` [PATCH 4/4] xfstests: remove manual declaration of errno Theodore Ts'o
2015-07-30 17:15   ` Christoph Hellwig

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=20150730171358.GA18185@infradead.org \
    --to=hch@infradead.org \
    --cc=fstests@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.