// #include <linux/falloc.h>
#define FALLOC_FL_KEEP_SIZE 0x01
#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
+#define FALLOC_FL_COLLAPSE_RANGE 0x08
+#define FALLOC_FL_ZERO_RANGE 0x10
void usage(void)
{
int error;
int tflag = 0;
- while ((opt = getopt(argc, argv, "npl:o:t")) != -1) {
+ while ((opt = getopt(argc, argv, "npl:o:tzc")) != -1) {
switch(opt) {
case 'n':
/* do not change filesize */
falloc_mode = (FALLOC_FL_PUNCH_HOLE |
FALLOC_FL_KEEP_SIZE);
break;
+ case 'c':
+ /* collapse range mode */
+ falloc_mode = (FALLOC_FL_COLLAPSE_RANGE |
+ FALLOC_FL_KEEP_SIZE);
+ break;
+ case 'z':
+ /* zero range mode */
+ falloc_mode = (FALLOC_FL_ZERO_RANGE |
+ FALLOC_FL_KEEP_SIZE);
+ break;
case 'l':
length = cvtnum(optarg);
break;