From: Nathan Scott Date: Tue, 8 Aug 2006 15:34:23 +0000 (+0000) Subject: Fix up warnings being reported by mkfs when running QA with an external log on a... X-Git-Tag: v2.9.0~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7695605494a97be3692afbdc31f2540a4d876829;p=thirdparty%2Fxfsprogs-dev.git Fix up warnings being reported by mkfs when running QA with an external log on a ramdisk. Merge of master-melb:xfs-cmds:26731a by kenmcd. --- diff --git a/libxfs/darwin.c b/libxfs/darwin.c index 59e479271..cb538d982 100644 --- a/libxfs/darwin.c +++ b/libxfs/darwin.c @@ -52,7 +52,7 @@ platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal) } void -platform_set_blocksize(int fd, char *path, int blocksize) +platform_set_blocksize(int fd, char *path, dev_t device, int blocksize) { } diff --git a/libxfs/freebsd.c b/libxfs/freebsd.c index a179fa8a6..441cb0ae9 100644 --- a/libxfs/freebsd.c +++ b/libxfs/freebsd.c @@ -92,7 +92,7 @@ platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal) } void -platform_set_blocksize(int fd, char *path, int blocksize) +platform_set_blocksize(int fd, char *path, dev_t device, int blocksize) { return; } diff --git a/libxfs/init.c b/libxfs/init.c index 21d040aba..7e3bb7254 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -116,9 +116,8 @@ retry: exit(1); } - if (!readonly && setblksize && (statb.st_mode & S_IFMT) == S_IFBLK) { - platform_set_blocksize(fd, path, 512); - } + if (!readonly && setblksize && (statb.st_mode & S_IFMT) == S_IFBLK) + platform_set_blocksize(fd, path, statb.st_rdev, 512); /* * Get the device number from the stat buf - unless diff --git a/libxfs/init.h b/libxfs/init.h index 60e89902c..38d90b901 100644 --- a/libxfs/init.h +++ b/libxfs/init.h @@ -25,7 +25,7 @@ extern int platform_check_ismounted (char *path, char *block, extern int platform_check_iswritable (char *path, char *block, struct stat64 *sptr, int fatal); extern void platform_findsizes (char *path, int fd, long long *sz, int *bsz); -extern void platform_set_blocksize (int fd, char *path, int blocksize); +extern void platform_set_blocksize (int fd, char *path, dev_t device, int bsz); extern void platform_flush_device (int fd, dev_t device); extern char *platform_findrawpath(char *path); extern char *platform_findrawpath (char *path); diff --git a/libxfs/irix.c b/libxfs/irix.c index b0f637aac..9869f77cb 100644 --- a/libxfs/irix.c +++ b/libxfs/irix.c @@ -36,7 +36,7 @@ platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal) } void -platform_set_blocksize(int fd, char *path, int blocksize) +platform_set_blocksize(int fd, char *path, dev_t device, int blocksize) { return; } diff --git a/libxfs/linux.c b/libxfs/linux.c index f2d975c43..08befd1a3 100644 --- a/libxfs/linux.c +++ b/libxfs/linux.c @@ -103,12 +103,14 @@ platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal) } void -platform_set_blocksize(int fd, char *path, int blocksize) +platform_set_blocksize(int fd, char *path, dev_t device, int blocksize) { - if (ioctl(fd, BLKBSZSET, &blocksize) < 0) { - fprintf(stderr, _("%s: warning - cannot set blocksize " - "on block device %s: %s\n"), - progname, path, strerror(errno)); + if (major(device) != RAMDISK_MAJOR) { + if (ioctl(fd, BLKBSZSET, &blocksize) < 0) { + fprintf(stderr, _("%s: warning - cannot set blocksize " + "on block device %s: %s\n"), + progname, path, strerror(errno)); + } } } @@ -202,12 +204,6 @@ int platform_align_blockdev(void) { if (!max_block_alignment) - abort(); + return getpagesize(); return max_block_alignment; } - -size_t -platform_memalignment(void) -{ - return getpagesize(); -}