Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.

2015-10-21 Thread Davide Italiano
On Wed, Jul 22, 2015 at 10:45 AM, Davide Italiano <dccitali...@gmail.com> wrote: > On Fri, Jun 26, 2015 at 7:08 AM, David Sterba <dste...@suse.cz> wrote: >> On Mon, Apr 06, 2015 at 10:09:15PM -0700, Davide Italiano wrote: >>> - We call inode_size_ok() only i

Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.

2015-07-22 Thread Davide Italiano
On Fri, Jun 26, 2015 at 7:08 AM, David Sterba dste...@suse.cz wrote: On Mon, Apr 06, 2015 at 10:09:15PM -0700, Davide Italiano wrote: - We call inode_size_ok() only if FL_KEEP_SIZE isn't specified. - As an optimisation we can skip the call if (off + len) isn't greater than the current size

Re: [PATCH 1/2] [btrfs] btrfs_rename: abort transaction in case of error.

2015-06-29 Thread Davide Italiano
On Mon, Jun 29, 2015 at 4:59 AM, Filipe David Manana fdman...@gmail.com wrote: On Sun, Jun 28, 2015 at 10:47 PM, Davide C. C. Italiano dccitali...@gmail.com wrote: From: Davide Italiano dccitali...@gmail.com btrfs_insert_inode_ref() may fail and we want to make sure the transaction

Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.

2015-06-25 Thread Davide Italiano
On Mon, Apr 20, 2015 at 1:49 PM, Davide Italiano dccitali...@gmail.com wrote: On Mon, Apr 6, 2015 at 10:09 PM, Davide Italiano dccitali...@gmail.com wrote: - We call inode_size_ok() only if FL_KEEP_SIZE isn't specified. - As an optimisation we can skip the call if (off + len) isn't greater

Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.

2015-04-20 Thread Davide Italiano
On Mon, Apr 6, 2015 at 10:09 PM, Davide Italiano dccitali...@gmail.com wrote: - We call inode_size_ok() only if FL_KEEP_SIZE isn't specified. - As an optimisation we can skip the call if (off + len) isn't greater than the current size of the file. This operation is called under the lock so

[PATCH] Improve FL_KEEP_SIZE handling

2015-04-06 Thread Davide Italiano
This matches the logic of ext4. I think it's more correct passing (offset + len) to inode_newsize_ok() rather than rounding up to block size. The call can be skipped in some cases too. It works for me but I'm new to this code so I might miss something. Let me know what you think. Davide Italiano

[PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.

2015-04-06 Thread Davide Italiano
to it the correct value rather than a more conservative estimation. Signed-off-by: Davide Italiano dccitali...@gmail.com --- fs/btrfs/file.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 30982bb..f649bfc 100644 --- a/fs/btrfs/file.c

[PATCH] Btrfs: RENAME_EXCHANGE semantic for renameat2()

2015-04-01 Thread Davide Italiano
Signed-off-by: Davide Italiano dccitali...@gmail.com --- fs/btrfs/inode.c | 190 ++- 1 file changed, 189 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d2e732d..49b0867 100644 --- a/fs/btrfs/inode.c +++ b/fs

[PATCH] Btrfs: implement RENAME_EXCHANGE semantic

2015-04-01 Thread Davide Italiano
This is an attempt to implement RENAME_EXCHANGE in btrfs. It survived basic testing and I think it's ready for others' feedback. I'll stress test {and, or} rewrite it depending on people's comments. Davide Italiano (1): Btrfs: RENAME_EXCHANGE semantic for renameat2() fs/btrfs/inode.c | 190