[PATCH] xfsprogs: add fpunch command for hole punching via fallocate
Christoph Hellwig
hch at infradead.org
Tue Jan 18 06:51:12 CST 2011
Looks mostly good, but I wonder what the point of a new command for this
is. It's just one new flag to fallocate, so I'd also implement it as
a flag to the fallocate command.
> @@ -153,8 +156,10 @@ fallocate_f(
> xfs_flock64_t segment;
> int mode = 0;
> int c;
> + const char *opts;
>
> - while ((c = getopt(argc, argv, "k")) != EOF) {
> + opts = "k";
> + while ((c = getopt(argc, argv, opts)) != EOF) {
> switch (c) {
> case 'k':
> mode = FALLOC_FL_KEEP_SIZE;
Why do you change unrelated code?
> +#if defined (FALLOC_FL_PUNCH_HOLE)
I'd rather have a
#ifndef FALLOC_FL_PUNCH_HOLE
#define FALLOC_FL_PUNCH_HOLE 0x02
#endif
to avoid requiring newest kernel headers.
More information about the xfs
mailing list