]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Revert "[RESEND, 4/7] xfsprogs: xfsio: add support FALLOC_FL_COLLAPSE_RANGE for fallo...
authorRich Johnston <rjohnston@sgi.com>
Tue, 22 Oct 2013 15:15:20 +0000 (10:15 -0500)
committerRich Johnston <rjohnston@sgi.com>
Tue, 22 Oct 2013 15:15:20 +0000 (10:15 -0500)
This reverts commit e64190f8440286a815060524777b435e06a7b364 until we
have the fallocate API support merged into the kernel. The kernel
code is still under review.

io/prealloc.c
man/man8/xfs_io.8

index 034301761c3533946c80a53e260d635ca78fb4e9..8380646ed83b7acfcc8543a67ccab0c916bedfff 100644 (file)
 #define FALLOC_FL_PUNCH_HOLE   0x02
 #endif
 
-#ifndef FALLOC_FL_COLLAPSE_RANGE
-#define FALLOC_FL_COLLAPSE_RANGE 0x08
-#endif
-
 static cmdinfo_t allocsp_cmd;
 static cmdinfo_t freesp_cmd;
 static cmdinfo_t resvsp_cmd;
@@ -41,7 +37,6 @@ static cmdinfo_t zero_cmd;
 #if defined(HAVE_FALLOCATE)
 static cmdinfo_t falloc_cmd;
 static cmdinfo_t fpunch_cmd;
-static cmdinfo_t fcollapse_cmd;
 #endif
 
 static int
@@ -164,11 +159,8 @@ fallocate_f(
        int             mode = 0;
        int             c;
 
-       while ((c = getopt(argc, argv, "ckp")) != EOF) {
+       while ((c = getopt(argc, argv, "kp")) != EOF) {
                switch (c) {
-               case 'c':
-                       mode = FALLOC_FL_COLLAPSE_RANGE;
-                       break;
                case 'k':
                        mode = FALLOC_FL_KEEP_SIZE;
                        break;
@@ -211,25 +203,6 @@ fpunch_f(
        }
        return 0;
 }
-
-static int
-fcollapse_f(
-       int             argc,
-       char            **argv)
-{
-       xfs_flock64_t   segment;
-       int             mode = FALLOC_FL_COLLAPSE_RANGE;
-
-       if (!offset_length(argv[1], argv[2], &segment))
-               return 0;
-
-       if (fallocate(file->fd, mode,
-                       segment.l_start, segment.l_len)) {
-               perror("fallocate");
-               return 0;
-       }
-       return 0;
-}
 #endif /* HAVE_FALLOCATE */
 
 void
@@ -304,15 +277,5 @@ prealloc_init(void)
        fpunch_cmd.oneline =
                _("de-allocates space assocated with part of a file via fallocate");
        add_command(&fpunch_cmd);
-
-       fcollapse_cmd.name = "fcollapse";
-       fcollapse_cmd.cfunc = fcollapse_f;
-       fcollapse_cmd.argmin = 2;
-       fcollapse_cmd.argmax = 2;
-       fcollapse_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
-       fcollapse_cmd.args = _("off len");
-       fcollapse_cmd.oneline =
-       _("de-allocates space and eliminates the hole by shifting extents");
-       add_command(&fcollapse_cmd);
 #endif /* HAVE_FALLOCATE */
 }
index 9543b20425c61e7c57ee6cd4fa5625025e90a08e..767b50ed86005697d6e7444a4a9e0b0bb95bd35d 100644 (file)
@@ -380,12 +380,6 @@ will set the FALLOC_FL_KEEP_SIZE flag as described in
 .PD
 .RE
 .TP
-.BI fcollapse " offset length"
-Call fallocate with FALLOC_FL_COLLAPSE_RANGE flag as described in the
-.BR fallocate (2)
-manual page to de-allocates blocks and eliminates the hole created in this process
-by shifting data blocks into the hole.
-.TP
 .BI fpunch " offset length"
 Punches (de-allocates) blocks in the file by calling fallocate with 
 the FALLOC_FL_PUNCH_HOLE flag as described in the