public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxfs: Get Physical Sector Size instead of Logical Sector size
@ 2011-11-24 19:20 Carlos Maiolino
  2011-11-24 19:50 ` Carlos Maiolino
  0 siblings, 1 reply; 14+ messages in thread
From: Carlos Maiolino @ 2011-11-24 19:20 UTC (permalink / raw)
  To: xfs; +Cc: Carlos Maiolino

xfsprogs (mainly mkfs) is using the logical sector size of a volume to initialize
the filesystem, which, even in devices using Advanced Format, it can get a 512
bytes sector size if it is set as the logical sector size.
This patch changes the ioctl to get the physical sector size, independent of the
logical size.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 libxfs/linux.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libxfs/linux.c b/libxfs/linux.c
index 2e07d54..0bc49dd 100644
--- a/libxfs/linux.c
+++ b/libxfs/linux.c
@@ -39,6 +39,9 @@ static int max_block_alignment;
 #ifndef BLKSSZGET
 # define BLKSSZGET	_IO(0x12,104)
 #endif
+#ifndef BLKPBSZGET
+# define BLKPBSZGET _IO(0x12,123)
+#endif
 
 #ifndef RAMDISK_MAJOR
 #define RAMDISK_MAJOR	1	/* ramdisk major number */
@@ -165,7 +168,7 @@ platform_findsizes(char *path, int fd, long long *sz, int *bsz)
 		*sz = (long long)tmpsize;
 	}
 
-	if (ioctl(fd, BLKSSZGET, bsz) < 0) {
+	if (ioctl(fd, BLKPBSZGET, bsz) < 0) {
 		fprintf(stderr, _("%s: warning - cannot get sector size "
 				"from block device %s: %s\n"),
 			progname, path, strerror(errno));
-- 
1.7.6.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-11-30 15:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-24 19:20 [PATCH] libxfs: Get Physical Sector Size instead of Logical Sector size Carlos Maiolino
2011-11-24 19:50 ` Carlos Maiolino
2011-11-27  1:06   ` Dave Chinner
2011-11-27 23:05     ` Eric Sandeen
2011-11-27 23:50       ` Dave Chinner
2011-11-28  7:56         ` Christoph Hellwig
2011-11-28 16:08         ` Martin K. Petersen
2011-11-28 16:11           ` Eric Sandeen
2011-11-29 17:15             ` Martin K. Petersen
2011-11-29 17:38               ` Eric Sandeen
2011-11-30  0:19                 ` Dave Chinner
2011-11-30 15:03                   ` Carlos Maiolino
2011-11-28 16:56           ` Greg Freemyer
2011-11-28  7:54       ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox