xfs
[Top] [All Lists]

Re: [PATCH 4/6] Ext4: fail if we try to use hole punch

To: Avi Kivity <avi@xxxxxxxxxx>
Subject: Re: [PATCH 4/6] Ext4: fail if we try to use hole punch
From: "Ted Ts'o" <tytso@xxxxxxx>
Date: Tue, 16 Nov 2010 22:06:40 -0500
Cc: Josef Bacik <josef@xxxxxxxxxx>, david@xxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, cmm@xxxxxxxxxx, cluster-devel@xxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx
In-reply-to: <4CE28211.6060204@xxxxxxxxxx>
Mail-followup-to: Ted Ts'o <tytso@xxxxxxx>, Avi Kivity <avi@xxxxxxxxxx>, Josef Bacik <josef@xxxxxxxxxx>, david@xxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, cmm@xxxxxxxxxx, cluster-devel@xxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx
References: <1289840723-3056-1-git-send-email-josef@xxxxxxxxxx> <1289840723-3056-5-git-send-email-josef@xxxxxxxxxx> <4CE2783F.1020004@xxxxxxxxxx> <20101116125016.GA31957@xxxxxxxxxxxxxxxxxxxxxxxxxx> <4CE28211.6060204@xxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
> >There is no simple way to test if a filesystem supports hole punching or not 
> >so
> >the check has to be done per fs.  Thanks,
> 
> Could put a flag word in superblock_operations.  Filesystems which
> support punching (or other features) can enable it there.

No, it couldn't be in super_operations.  It may vary on a per-inode
basis for some file systems, such as ext4 (depending on whether the
inode is extent-mapped or indirect-block mapped).

So at least for ext4 we'd need to call into fallocate() function
anyway, once we add support.  I suppose if other file systems really
want it, we could add a flag to the super block ops structure, so they
don't have do the "do we support the punch" operation.  I can go
either way on that; although if we think the majority of file systems
are going support punch in the long-term, then it might not be worth
it to add such a flag.

                                                - Ted

<Prev in Thread] Current Thread [Next in Thread>