[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 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
 
 
diff --git a/lib/write_log.c b/lib/write_log.c
index 8c921fc..852a2ae 100644
--- a/lib/write_log.c
+++ b/lib/write_log.c
@@ -62,7 +62,11 @@
 
 #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
-- 
2.3.0

--
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