Re: Hole Punching V3

Previous thread: [PATCH 6/6] Gfs2: fail if we try to use hole punch by Josef Bacik on Wednesday, November 17, 2010 - 6:46 pm. (1 message)

Next thread: linux-next: Tree for November 18 by Stephen Rothwell on Wednesday, November 17, 2010 - 7:42 pm. (11 messages)
From: Josef Bacik
Date: Wednesday, November 17, 2010 - 6:46 pm

This is version 3 of the hole punching series I've been posting.  Not much has
changed, the history is below

V2->V3
-FALLOC_FL_PUNCH_HOLE must also have FALLOC_FL_KEEP_SIZE in order to work
-formatting fixes

V1->V2
-Hole punching doesn't change file size
-Fixed the mode checks in ext4/btrfs/gfs2 so they do what they are supposed to

I've updated my local copies of the xfsprogs patches I have to test this to use
KEEP_SIZE and PUNCH_HOLE together, I'll post them after it looks like these
patches are good to go, including the manpage update.  The xfstest I wrote ran
fine both on xfs and btrfs (failing on btrfs obviously).  Thanks,

Josef
--

From: Josef Bacik
Date: Wednesday, November 17, 2010 - 6:46 pm

Ext4 doesn't have the ability to punch holes yet, so make sure we return
EOPNOTSUPP if we try to use hole punching through fallocate.  This support can
be added later.  Thanks,

Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Josef Bacik <josef@redhat.com>
---
 fs/ext4/extents.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 0554c48..35bca73 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3622,6 +3622,10 @@ long ext4_fallocate(struct inode *inode, int mode, loff_t offset, loff_t len)
 	struct ext4_map_blocks map;
 	unsigned int credits, blkbits = inode->i_blkbits;
 
+	/* We only support the FALLOC_FL_KEEP_SIZE mode */
+	if (mode && (mode != FALLOC_FL_KEEP_SIZE))
+		return -EOPNOTSUPP;
+
 	/*
 	 * currently supporting (pre)allocate mode for extent-based
 	 * files _only_
-- 
1.6.6.1

--

From: Josef Bacik
Date: Monday, January 3, 2011 - 2:57 pm

I'd like to try and get this into the next merge window, it seems everybody is
happy with it so far, any other comments?  Provided everybody is ok with it, how
would you like me to send it to you Linus?  Would you prefer a pull request or
will you just pull the patches off the mailinglist?  Thanks,

Josef
--

Previous thread: [PATCH 6/6] Gfs2: fail if we try to use hole punch by Josef Bacik on Wednesday, November 17, 2010 - 6:46 pm. (1 message)

Next thread: linux-next: Tree for November 18 by Stephen Rothwell on Wednesday, November 17, 2010 - 7:42 pm. (11 messages)