Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-12 Thread Andreas Dilger
On Jul 12, 2007 13:56 +0530, Amit K. Arora wrote: > As you suggest, let us just have two modes for the time being: > > #define FALLOC_ALLOCATE 0x1 > #define FALLOC_ALLOCATE_KEEP_SIZE 0x2 > > As the name suggests, when FALLOC_ALLOCATE_KEEP_SIZE mode is passed it > will

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-12 Thread Amit K. Arora
On Thu, Jul 12, 2007 at 11:13:34PM +1000, David Chinner wrote: > On Thu, Jul 12, 2007 at 12:58:13PM +0530, Suparna Bhattacharya wrote: > > > > Why don't we just merge the interface for preallocation (essentially > > enough to satisfy posix_fallocate() and the simple XFS requirement for > > space

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-12 Thread David Chinner
On Thu, Jul 12, 2007 at 12:58:13PM +0530, Suparna Bhattacharya wrote: > > Why don't we just merge the interface for preallocation (essentially > enough to satisfy posix_fallocate() and the simple XFS requirement for > space reservation without changing file size), which there is clear agreement

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-12 Thread Amit K. Arora
On Thu, Jul 12, 2007 at 12:58:13PM +0530, Suparna Bhattacharya wrote: > On Wed, Jul 11, 2007 at 10:03:12AM +0100, Christoph Hellwig wrote: > > On Tue, Jul 03, 2007 at 05:16:50PM +0530, Amit K. Arora wrote: > > > Well, if you see the modes proposed using above flags : > > > > > > #define

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-12 Thread Suparna Bhattacharya
On Wed, Jul 11, 2007 at 10:03:12AM +0100, Christoph Hellwig wrote: > On Tue, Jul 03, 2007 at 05:16:50PM +0530, Amit K. Arora wrote: > > Well, if you see the modes proposed using above flags : > > > > #define FA_ALLOCATE 0 > > #define FA_DEALLOCATE FA_FL_DEALLOC > > #define FA_RESV_SPACE

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-12 Thread Suparna Bhattacharya
On Wed, Jul 11, 2007 at 10:03:12AM +0100, Christoph Hellwig wrote: On Tue, Jul 03, 2007 at 05:16:50PM +0530, Amit K. Arora wrote: Well, if you see the modes proposed using above flags : #define FA_ALLOCATE 0 #define FA_DEALLOCATE FA_FL_DEALLOC #define FA_RESV_SPACE

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-12 Thread Amit K. Arora
On Thu, Jul 12, 2007 at 12:58:13PM +0530, Suparna Bhattacharya wrote: On Wed, Jul 11, 2007 at 10:03:12AM +0100, Christoph Hellwig wrote: On Tue, Jul 03, 2007 at 05:16:50PM +0530, Amit K. Arora wrote: Well, if you see the modes proposed using above flags : #define FA_ALLOCATE 0

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-12 Thread David Chinner
On Thu, Jul 12, 2007 at 12:58:13PM +0530, Suparna Bhattacharya wrote: Why don't we just merge the interface for preallocation (essentially enough to satisfy posix_fallocate() and the simple XFS requirement for space reservation without changing file size), which there is clear agreement on

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-12 Thread Amit K. Arora
On Thu, Jul 12, 2007 at 11:13:34PM +1000, David Chinner wrote: On Thu, Jul 12, 2007 at 12:58:13PM +0530, Suparna Bhattacharya wrote: Why don't we just merge the interface for preallocation (essentially enough to satisfy posix_fallocate() and the simple XFS requirement for space

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-12 Thread Andreas Dilger
On Jul 12, 2007 13:56 +0530, Amit K. Arora wrote: As you suggest, let us just have two modes for the time being: #define FALLOC_ALLOCATE 0x1 #define FALLOC_ALLOCATE_KEEP_SIZE 0x2 As the name suggests, when FALLOC_ALLOCATE_KEEP_SIZE mode is passed it will result

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-11 Thread Christoph Hellwig
On Mon, Jul 02, 2007 at 08:55:43AM +1000, David Chinner wrote: > Given the current behaviour for posix_fallocate() in glibc, I think > that retaining the same error semantic and punting the cleanup to > userspace (where the app will fail with ENOSPC anyway) is the only > sane thing we can do here.

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-11 Thread Christoph Hellwig
On Wed, Jul 04, 2007 at 03:37:01PM +1000, Timothy Shimmin wrote: > We use this capability in XFS at the moment. > I think this is mainly for DMF (HSM) but is done via the xfs handle > interface > (xfs_open_by_handle) AFAICT. > You're not :) You're using an O_INVIBLE equivalent (as described

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-11 Thread Christoph Hellwig
On Tue, Jul 03, 2007 at 05:16:50PM +0530, Amit K. Arora wrote: > Well, if you see the modes proposed using above flags : > > #define FA_ALLOCATE 0 > #define FA_DEALLOCATE FA_FL_DEALLOC > #define FA_RESV_SPACE FA_FL_KEEP_SIZE > #define FA_UNRESV_SPACE (FA_FL_DEALLOC | FA_FL_KEEP_SIZE | >

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-11 Thread Christoph Hellwig
On Tue, Jul 03, 2007 at 05:16:50PM +0530, Amit K. Arora wrote: Well, if you see the modes proposed using above flags : #define FA_ALLOCATE 0 #define FA_DEALLOCATE FA_FL_DEALLOC #define FA_RESV_SPACE FA_FL_KEEP_SIZE #define FA_UNRESV_SPACE (FA_FL_DEALLOC | FA_FL_KEEP_SIZE |

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-11 Thread Christoph Hellwig
On Wed, Jul 04, 2007 at 03:37:01PM +1000, Timothy Shimmin wrote: We use this capability in XFS at the moment. I think this is mainly for DMF (HSM) but is done via the xfs handle interface (xfs_open_by_handle) AFAICT. You're not :) You're using an O_INVIBLE equivalent (as described below),

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-11 Thread Christoph Hellwig
On Mon, Jul 02, 2007 at 08:55:43AM +1000, David Chinner wrote: Given the current behaviour for posix_fallocate() in glibc, I think that retaining the same error semantic and punting the cleanup to userspace (where the app will fail with ENOSPC anyway) is the only sane thing we can do here.

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-03 Thread Timothy Shimmin
Amit K. Arora wrote: FA_FL_NO_MTIME 0x10 /* keep same mtime (default change on size, data change) */ FA_FL_NO_CTIME 0x20 /* keep same ctime (default change on size, data change) */ NACK to these aswell. If i_size changes c/mtime need updates, if the size doesn't chamge they don't. No need

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-03 Thread Amit K. Arora
On Tue, Jul 03, 2007 at 11:31:07AM +0100, Christoph Hellwig wrote: > On Tue, Jul 03, 2007 at 03:38:48PM +0530, Amit K. Arora wrote: > > > FA_FL_DEALLOC 0x01 /* deallocate unwritten extent (default > > > allocate) */ > > > FA_FL_KEEP_SIZE 0x02 /* keep size for EOF {pre,de}alloc

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-03 Thread Christoph Hellwig
On Tue, Jul 03, 2007 at 03:38:48PM +0530, Amit K. Arora wrote: > > FA_FL_DEALLOC 0x01 /* deallocate unwritten extent (default > > allocate) */ > > FA_FL_KEEP_SIZE 0x02 /* keep size for EOF {pre,de}alloc (default change > > size) */ > > FA_FL_DEL_DATA 0x04 /* delete

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-03 Thread Amit K. Arora
On Sat, Jun 30, 2007 at 12:52:46PM -0400, Andreas Dilger wrote: > The @mode flags that are currently under consideration are (AFAIK): > > FA_FL_DEALLOC 0x01 /* deallocate unwritten extent (default allocate) > */ > FA_FL_KEEP_SIZE 0x02 /* keep size for EOF {pre,de}alloc (default

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-03 Thread Amit K. Arora
On Sat, Jun 30, 2007 at 12:52:46PM -0400, Andreas Dilger wrote: The @mode flags that are currently under consideration are (AFAIK): FA_FL_DEALLOC 0x01 /* deallocate unwritten extent (default allocate) */ FA_FL_KEEP_SIZE 0x02 /* keep size for EOF {pre,de}alloc (default change

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-03 Thread Christoph Hellwig
On Tue, Jul 03, 2007 at 03:38:48PM +0530, Amit K. Arora wrote: FA_FL_DEALLOC 0x01 /* deallocate unwritten extent (default allocate) */ FA_FL_KEEP_SIZE 0x02 /* keep size for EOF {pre,de}alloc (default change size) */ FA_FL_DEL_DATA 0x04 /* delete existing data in

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-03 Thread Amit K. Arora
On Tue, Jul 03, 2007 at 11:31:07AM +0100, Christoph Hellwig wrote: On Tue, Jul 03, 2007 at 03:38:48PM +0530, Amit K. Arora wrote: FA_FL_DEALLOC 0x01 /* deallocate unwritten extent (default allocate) */ FA_FL_KEEP_SIZE 0x02 /* keep size for EOF {pre,de}alloc (default change

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-03 Thread Timothy Shimmin
Amit K. Arora wrote: FA_FL_NO_MTIME 0x10 /* keep same mtime (default change on size, data change) */ FA_FL_NO_CTIME 0x20 /* keep same ctime (default change on size, data change) */ NACK to these aswell. If i_size changes c/mtime need updates, if the size doesn't chamge they don't. No need

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-02 Thread Amit K. Arora
On Mon, Jul 02, 2007 at 08:55:43AM +1000, David Chinner wrote: > On Sat, Jun 30, 2007 at 11:21:11AM +0100, Christoph Hellwig wrote: > > On Tue, Jun 26, 2007 at 04:02:47PM +0530, Amit K. Arora wrote: > > > > Can you clarify - what is the current behaviour when ENOSPC (or some > > > > other > > > >

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-02 Thread Amit K. Arora
On Mon, Jul 02, 2007 at 08:55:43AM +1000, David Chinner wrote: On Sat, Jun 30, 2007 at 11:21:11AM +0100, Christoph Hellwig wrote: On Tue, Jun 26, 2007 at 04:02:47PM +0530, Amit K. Arora wrote: Can you clarify - what is the current behaviour when ENOSPC (or some other error) is hit?

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-01 Thread David Chinner
On Sat, Jun 30, 2007 at 11:21:11AM +0100, Christoph Hellwig wrote: > On Tue, Jun 26, 2007 at 04:02:47PM +0530, Amit K. Arora wrote: > > > Can you clarify - what is the current behaviour when ENOSPC (or some other > > > error) is hit? Does it keep the current fallocate() or does it free it? > > >

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-01 Thread Andreas Dilger
On Jun 30, 2007 11:21 +0100, Christoph Hellwig wrote: > On Tue, Jun 26, 2007 at 04:02:47PM +0530, Amit K. Arora wrote: > > Currently it is left on the file system implementation. In ext4, we do > > not undo preallocation if some error (say, ENOSPC) is hit. Hence it may > > end up with partial

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-01 Thread Andreas Dilger
On Jun 30, 2007 11:21 +0100, Christoph Hellwig wrote: On Tue, Jun 26, 2007 at 04:02:47PM +0530, Amit K. Arora wrote: Currently it is left on the file system implementation. In ext4, we do not undo preallocation if some error (say, ENOSPC) is hit. Hence it may end up with partial

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-07-01 Thread David Chinner
On Sat, Jun 30, 2007 at 11:21:11AM +0100, Christoph Hellwig wrote: On Tue, Jun 26, 2007 at 04:02:47PM +0530, Amit K. Arora wrote: Can you clarify - what is the current behaviour when ENOSPC (or some other error) is hit? Does it keep the current fallocate() or does it free it?

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-30 Thread Christoph Hellwig
On Tue, Jun 26, 2007 at 04:02:47PM +0530, Amit K. Arora wrote: > > Can you clarify - what is the current behaviour when ENOSPC (or some other > > error) is hit? Does it keep the current fallocate() or does it free it? > > Currently it is left on the file system implementation. In ext4, we do >

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-30 Thread Christoph Hellwig
On Tue, Jun 26, 2007 at 04:02:47PM +0530, Amit K. Arora wrote: Can you clarify - what is the current behaviour when ENOSPC (or some other error) is hit? Does it keep the current fallocate() or does it free it? Currently it is left on the file system implementation. In ext4, we do not undo

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-28 Thread David Chinner
On Thu, Jun 28, 2007 at 11:49:13PM +0530, Amit K. Arora wrote: > On Wed, Jun 27, 2007 at 09:18:04AM +1000, David Chinner wrote: > > On Tue, Jun 26, 2007 at 11:34:13AM -0400, Andreas Dilger wrote: > > > On Jun 26, 2007 16:02 +0530, Amit K. Arora wrote: > > > > On Mon, Jun 25, 2007 at 03:46:26PM

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-28 Thread Nathan Scott
On Thu, 2007-06-28 at 23:49 +0530, Amit K. Arora wrote: > > > Correct, but for swap files that's not an issue - no user should be > able > > too read them, and FA_MKSWAP would really need root privileges to > execute. > > Will the FA_MKSWAP mode still be required with your suggested change > of

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-28 Thread Amit K. Arora
On Wed, Jun 27, 2007 at 09:18:04AM +1000, David Chinner wrote: > On Tue, Jun 26, 2007 at 11:34:13AM -0400, Andreas Dilger wrote: > > On Jun 26, 2007 16:02 +0530, Amit K. Arora wrote: > > > On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: > > > > Can you clarify - what is the

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-28 Thread Amit K. Arora
On Wed, Jun 27, 2007 at 09:18:04AM +1000, David Chinner wrote: On Tue, Jun 26, 2007 at 11:34:13AM -0400, Andreas Dilger wrote: On Jun 26, 2007 16:02 +0530, Amit K. Arora wrote: On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: Can you clarify - what is the current

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-28 Thread Nathan Scott
On Thu, 2007-06-28 at 23:49 +0530, Amit K. Arora wrote: Correct, but for swap files that's not an issue - no user should be able too read them, and FA_MKSWAP would really need root privileges to execute. Will the FA_MKSWAP mode still be required with your suggested change of teaching

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-28 Thread David Chinner
On Thu, Jun 28, 2007 at 11:49:13PM +0530, Amit K. Arora wrote: On Wed, Jun 27, 2007 at 09:18:04AM +1000, David Chinner wrote: On Tue, Jun 26, 2007 at 11:34:13AM -0400, Andreas Dilger wrote: On Jun 26, 2007 16:02 +0530, Amit K. Arora wrote: On Mon, Jun 25, 2007 at 03:46:26PM -0600,

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread David Chinner
On Tue, Jun 26, 2007 at 11:42:50AM -0400, Andreas Dilger wrote: > On Jun 26, 2007 16:15 +0530, Amit K. Arora wrote: > > On Mon, Jun 25, 2007 at 03:52:39PM -0600, Andreas Dilger wrote: > > > In XFS one of the (many) ALLOC modes is to zero existing data on allocate. > > > For ext4 all this would

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread David Chinner
On Mon, Jun 25, 2007 at 03:52:39PM -0600, Andreas Dilger wrote: > On Jun 25, 2007 19:15 +0530, Amit K. Arora wrote: > > +#define FA_FL_DEALLOC 0x01 /* default is allocate */ > > +#define FA_FL_KEEP_SIZE0x02 /* default is extend/shrink size */ > > +#define FA_FL_DEL_DATA 0x04 /*

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread David Chinner
On Tue, Jun 26, 2007 at 11:34:13AM -0400, Andreas Dilger wrote: > On Jun 26, 2007 16:02 +0530, Amit K. Arora wrote: > > On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: > > > Can you clarify - what is the current behaviour when ENOSPC (or some other > > > error) is hit? Does it

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread David Chinner
On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: > On Jun 25, 2007 20:33 +0530, Amit K. Arora wrote: > > I have not implemented FA_FL_FREE_ENOSPC and FA_ZERO_SPACE flags yet, as > > *suggested* by Andreas in http://lkml.org/lkml/2007/6/14/323 post. > > If it is decided that these

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Amit K. Arora
On Tue, Jun 26, 2007 at 11:42:50AM -0400, Andreas Dilger wrote: > On Jun 26, 2007 16:15 +0530, Amit K. Arora wrote: > > On Mon, Jun 25, 2007 at 03:52:39PM -0600, Andreas Dilger wrote: > > > In XFS one of the (many) ALLOC modes is to zero existing data on allocate. > > > For ext4 all this would

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Amit K. Arora
On Tue, Jun 26, 2007 at 11:34:13AM -0400, Andreas Dilger wrote: > On Jun 26, 2007 16:02 +0530, Amit K. Arora wrote: > > On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: > > > Can you clarify - what is the current behaviour when ENOSPC (or some other > > > error) is hit? Does it

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Andreas Dilger
On Jun 26, 2007 16:15 +0530, Amit K. Arora wrote: > On Mon, Jun 25, 2007 at 03:52:39PM -0600, Andreas Dilger wrote: > > In XFS one of the (many) ALLOC modes is to zero existing data on allocate. > > For ext4 all this would mean is calling ext4_ext_mark_uninitialized() on > > each extent. For

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Andreas Dilger
On Jun 26, 2007 16:02 +0530, Amit K. Arora wrote: > On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: > > Can you clarify - what is the current behaviour when ENOSPC (or some other > > error) is hit? Does it keep the current fallocate() or does it free it? > > Currently it is left

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Amit K. Arora
On Mon, Jun 25, 2007 at 03:52:39PM -0600, Andreas Dilger wrote: > On Jun 25, 2007 19:15 +0530, Amit K. Arora wrote: > > +#define FA_FL_DEALLOC 0x01 /* default is allocate */ > > +#define FA_FL_KEEP_SIZE0x02 /* default is extend/shrink size */ > > +#define FA_FL_DEL_DATA 0x04 /*

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Amit K. Arora
On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: > On Jun 25, 2007 20:33 +0530, Amit K. Arora wrote: > > I have not implemented FA_FL_FREE_ENOSPC and FA_ZERO_SPACE flags yet, as > > *suggested* by Andreas in http://lkml.org/lkml/2007/6/14/323 post. > > If it is decided that these

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Amit K. Arora
On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: On Jun 25, 2007 20:33 +0530, Amit K. Arora wrote: I have not implemented FA_FL_FREE_ENOSPC and FA_ZERO_SPACE flags yet, as *suggested* by Andreas in http://lkml.org/lkml/2007/6/14/323 post. If it is decided that these flags

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Amit K. Arora
On Mon, Jun 25, 2007 at 03:52:39PM -0600, Andreas Dilger wrote: On Jun 25, 2007 19:15 +0530, Amit K. Arora wrote: +#define FA_FL_DEALLOC 0x01 /* default is allocate */ +#define FA_FL_KEEP_SIZE0x02 /* default is extend/shrink size */ +#define FA_FL_DEL_DATA 0x04 /* default is

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Andreas Dilger
On Jun 26, 2007 16:02 +0530, Amit K. Arora wrote: On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: Can you clarify - what is the current behaviour when ENOSPC (or some other error) is hit? Does it keep the current fallocate() or does it free it? Currently it is left on the

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Andreas Dilger
On Jun 26, 2007 16:15 +0530, Amit K. Arora wrote: On Mon, Jun 25, 2007 at 03:52:39PM -0600, Andreas Dilger wrote: In XFS one of the (many) ALLOC modes is to zero existing data on allocate. For ext4 all this would mean is calling ext4_ext_mark_uninitialized() on each extent. For some

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Amit K. Arora
On Tue, Jun 26, 2007 at 11:34:13AM -0400, Andreas Dilger wrote: On Jun 26, 2007 16:02 +0530, Amit K. Arora wrote: On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: Can you clarify - what is the current behaviour when ENOSPC (or some other error) is hit? Does it keep the

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread Amit K. Arora
On Tue, Jun 26, 2007 at 11:42:50AM -0400, Andreas Dilger wrote: On Jun 26, 2007 16:15 +0530, Amit K. Arora wrote: On Mon, Jun 25, 2007 at 03:52:39PM -0600, Andreas Dilger wrote: In XFS one of the (many) ALLOC modes is to zero existing data on allocate. For ext4 all this would mean is

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread David Chinner
On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: On Jun 25, 2007 20:33 +0530, Amit K. Arora wrote: I have not implemented FA_FL_FREE_ENOSPC and FA_ZERO_SPACE flags yet, as *suggested* by Andreas in http://lkml.org/lkml/2007/6/14/323 post. If it is decided that these flags

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread David Chinner
On Tue, Jun 26, 2007 at 11:34:13AM -0400, Andreas Dilger wrote: On Jun 26, 2007 16:02 +0530, Amit K. Arora wrote: On Mon, Jun 25, 2007 at 03:46:26PM -0600, Andreas Dilger wrote: Can you clarify - what is the current behaviour when ENOSPC (or some other error) is hit? Does it keep the

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread David Chinner
On Mon, Jun 25, 2007 at 03:52:39PM -0600, Andreas Dilger wrote: On Jun 25, 2007 19:15 +0530, Amit K. Arora wrote: +#define FA_FL_DEALLOC 0x01 /* default is allocate */ +#define FA_FL_KEEP_SIZE0x02 /* default is extend/shrink size */ +#define FA_FL_DEL_DATA 0x04 /* default is

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-26 Thread David Chinner
On Tue, Jun 26, 2007 at 11:42:50AM -0400, Andreas Dilger wrote: On Jun 26, 2007 16:15 +0530, Amit K. Arora wrote: On Mon, Jun 25, 2007 at 03:52:39PM -0600, Andreas Dilger wrote: In XFS one of the (many) ALLOC modes is to zero existing data on allocate. For ext4 all this would mean is

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-25 Thread Andreas Dilger
On Jun 25, 2007 19:15 +0530, Amit K. Arora wrote: > +#define FA_FL_DEALLOC0x01 /* default is allocate */ > +#define FA_FL_KEEP_SIZE 0x02 /* default is extend/shrink size */ > +#define FA_FL_DEL_DATA 0x04 /* default is keep written data on DEALLOC > */ In XFS one of the (many)

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-25 Thread Andreas Dilger
On Jun 25, 2007 20:33 +0530, Amit K. Arora wrote: > I have not implemented FA_FL_FREE_ENOSPC and FA_ZERO_SPACE flags yet, as > *suggested* by Andreas in http://lkml.org/lkml/2007/6/14/323 post. > If it is decided that these flags are also needed, I will update this > patch. Thanks! Can you

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-25 Thread Amit K. Arora
I have not implemented FA_FL_FREE_ENOSPC and FA_ZERO_SPACE flags yet, as *suggested* by Andreas in http://lkml.org/lkml/2007/6/14/323 post. If it is decided that these flags are also needed, I will update this patch. Thanks! On Mon, Jun 25, 2007 at 07:15:00PM +0530, Amit K. Arora wrote: >

[PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-25 Thread Amit K. Arora
Implement new flags and values for mode argument. This patch implements the new flags and values for the "mode" argument of the fallocate system call. It is based on the discussion between Andreas Dilger and David Chinner on the man page proposed (by the later) on fallocate. Signed-off-by: Amit

[PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-25 Thread Amit K. Arora
Implement new flags and values for mode argument. This patch implements the new flags and values for the mode argument of the fallocate system call. It is based on the discussion between Andreas Dilger and David Chinner on the man page proposed (by the later) on fallocate. Signed-off-by: Amit

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-25 Thread Amit K. Arora
I have not implemented FA_FL_FREE_ENOSPC and FA_ZERO_SPACE flags yet, as *suggested* by Andreas in http://lkml.org/lkml/2007/6/14/323 post. If it is decided that these flags are also needed, I will update this patch. Thanks! On Mon, Jun 25, 2007 at 07:15:00PM +0530, Amit K. Arora wrote:

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-25 Thread Andreas Dilger
On Jun 25, 2007 20:33 +0530, Amit K. Arora wrote: I have not implemented FA_FL_FREE_ENOSPC and FA_ZERO_SPACE flags yet, as *suggested* by Andreas in http://lkml.org/lkml/2007/6/14/323 post. If it is decided that these flags are also needed, I will update this patch. Thanks! Can you clarify

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

2007-06-25 Thread Andreas Dilger
On Jun 25, 2007 19:15 +0530, Amit K. Arora wrote: +#define FA_FL_DEALLOC0x01 /* default is allocate */ +#define FA_FL_KEEP_SIZE 0x02 /* default is extend/shrink size */ +#define FA_FL_DEL_DATA 0x04 /* default is keep written data on DEALLOC */ In XFS one of the (many)