Merge of master-melb:xfs-cmds:26731a by kenmcd.
}
void
-platform_set_blocksize(int fd, char *path, int blocksize)
+platform_set_blocksize(int fd, char *path, dev_t device, int blocksize)
{
}
}
void
-platform_set_blocksize(int fd, char *path, int blocksize)
+platform_set_blocksize(int fd, char *path, dev_t device, int blocksize)
{
return;
}
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
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);
}
void
-platform_set_blocksize(int fd, char *path, int blocksize)
+platform_set_blocksize(int fd, char *path, dev_t device, int blocksize)
{
return;
}
}
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));
+ }
}
}
platform_align_blockdev(void)
{
if (!max_block_alignment)
- abort();
+ return getpagesize();
return max_block_alignment;
}
-
-size_t
-platform_memalignment(void)
-{
- return getpagesize();
-}