blocksize on the device.
Merge of master-melb:xfs-cmds:27144a by kenmcd.
bump
#
PKG_MAJOR=2
PKG_MINOR=8
-PKG_REVISION=13
+PKG_REVISION=14
PKG_BUILD=1
-xfsprogs-2.8.xx (??)
+xfsprogs-2.8.14 (6 October 2006)
- Fix up the ring command in xfs_db,
thanks to Utako Kusaka
+ - Set the blocksize on the device to the given sector
+ size which is _not_ necessarily 512 bytes;
+ idea suggested by Shailendra Tripathi.
+ - Fix up xfs_copy and its variable argument handling
+ around vfprintf; xfs_copy was seg faulting on x86_64.
xfsprogs-2.8.13 (21 September 2006)
- Fix v2 directory checking with holes and unreadable blocks.
return (writable == 0);
}
-void
-platform_set_blocksize(int fd, char *path, dev_t device, int blocksize)
+int
+platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fatal)
{
+ return fatal;
}
void
return 0;
}
-void
-platform_set_blocksize(int fd, char *path, dev_t device, int blocksize)
+int
+platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fatal)
{
- return;
+ return fatal;
}
void
exit(1);
}
- if (!readonly && setblksize && (statb.st_mode & S_IFMT) == S_IFBLK)
- platform_set_blocksize(fd, path, statb.st_rdev, 512);
+ if (!readonly && setblksize && (statb.st_mode & S_IFMT) == S_IFBLK) {
+ if (setblksize == 1)
+ /* use the default blocksize */
+ (void)platform_set_blocksize(fd, path, statb.st_rdev, XFS_MIN_SECTORSIZE, 0);
+ else {
+ /* given an explicit blocksize to use */
+ if (platform_set_blocksize(fd, path, statb.st_rdev, setblksize, 1))
+ exit(1);
+ }
+ }
/*
* 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, dev_t device, int bsz);
+extern int platform_set_blocksize (int fd, char *path, dev_t device, int bsz, int fatal);
extern void platform_flush_device (int fd, dev_t device);
extern char *platform_findrawpath(char *path);
extern char *platform_findrawpath (char *path);
return 1;
}
-void
-platform_set_blocksize(int fd, char *path, dev_t device, int blocksize)
+int
+platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fatal)
{
- return;
+ return fatal;
}
void
return sts;
}
-void
-platform_set_blocksize(int fd, char *path, dev_t device, int blocksize)
+int
+platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fatal)
{
+ int error = 0;
+
if (major(device) != RAMDISK_MAJOR) {
- if (ioctl(fd, BLKBSZSET, &blocksize) < 0) {
- fprintf(stderr, _("%s: warning - cannot set blocksize "
+ if ((error = ioctl(fd, BLKBSZSET, &blocksize)) < 0) {
+ fprintf(stderr, _("%s: %s - cannot set blocksize "
"on block device %s: %s\n"),
- progname, path, strerror(errno));
+ progname, fatal ? "error": "warning",
+ path, strerror(errno));
}
}
+ return error;
}
void
bzero(&fsx, sizeof(fsx));
bzero(&xi, sizeof(xi));
- xi.setblksize = 1;
xi.isdirect = LIBXFS_DIRECT;
xi.isreadonly = LIBXFS_EXCLUSIVELY;
calc_stripe_factors(dsu, dsw, sectorsize, lsu, lsectorsize,
&dsunit, &dswidth, &lsunit);
+ if (slflag || ssflag)
+ xi.setblksize = sectorsize;
+ else
+ xi.setblksize = 1;
+
/*
* Initialize. This will open the log and rt devices as well.
*/