[Ocfs2-devel] [PATCH 3/9 v6] ocfs2: add orphan recovery types in ocfs2_recover_orphans

2015-01-20 Thread Joseph Qi
Define two orphan recovery types, which indicates if need truncate file or not. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/journal.c | 108 +++-- fs/ocfs2/ocfs2.h | 5 +++ 2 files changed, 93

[Ocfs2-devel] [PATCH 5/9 v6] ocfs2: allocate blocks in ocfs2_direct_IO_get_blocks

2015-01-20 Thread Joseph Qi
Allow blocks allocation in ocfs2_direct_IO_get_blocks. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/aops.c | 45 ++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/aops.c

[Ocfs2-devel] [PATCH 4/9 v6] ocfs2: implement ocfs2_direct_IO_write

2015-01-20 Thread Joseph Qi
Implement ocfs2_direct_IO_write. Add the inode to orphan dir first, and then delete it once append O_DIRECT finished. This is to make sure block allocation and inode size are consistent. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/aops.c |

[Ocfs2-devel] [PATCH 8/9 v6] ocfs2: wait for orphan recovery first once append O_DIRECT write crash

2015-01-20 Thread Joseph Qi
If one node has crashed with orphan entry leftover, another node which do append O_DIRECT write to the same file will override the i_dio_orphaned_slot. Then the old entry won't be cleaned forever. If this case happens, we let it wait for orphan recovery first. Cc: Weiwei Wang

[Ocfs2-devel] [PATCH 2/9 v6] ocfs2: add functions to add and remove inode in orphan dir

2015-01-20 Thread Joseph Qi
Add functions to add inode to orphan dir and remove inode in orphan dir. Here we do not call ocfs2_prepare_orphan_dir and ocfs2_orphan_add directly. Because append O_DIRECT will add inode to orphan two and may result in more than one orphan entry for the same inode. Signed-off-by: Joseph Qi

[Ocfs2-devel] [PATCH 1/9 v6] ocfs2: prepare some interfaces used in append direct io

2015-01-20 Thread Joseph Qi
Prepare some interfaces which will be used in append O_DIRECT write. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/file.c | 11 +-- fs/ocfs2/file.h | 9 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git

Re: [Ocfs2-devel] [PATCH 0/9 v6] ocfs2: support append O_DIRECT write

2015-01-20 Thread Junxiao Bi
Hi Joseph, Did this version make any performance improvement with v5? I tested v5, and it didn't improve performance with original buffer write + sync. Thanks, Junxiao. On 01/20/2015 04:01 PM, Joseph Qi wrote: Currently in case of append O_DIRECT write (block not allocated yet), ocfs2 will

[Ocfs2-devel] [PATCH 9/9 v6] ocfs2: set append dio as a ro compat feature

2015-01-20 Thread Joseph Qi
Intruduce a bit OCFS2_FEATURE_RO_COMPAT_APPEND_DIO and check it in write flow. If the bit is not set, fall back to the old way. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/file.c | 17 - fs/ocfs2/ocfs2.h| 8

[Ocfs2-devel] [PATCH 0/9 v6] ocfs2: support append O_DIRECT write

2015-01-20 Thread Joseph Qi
Currently in case of append O_DIRECT write (block not allocated yet), ocfs2 will fall back to buffered I/O. This has some disadvantages. Firstly, it is not the behavior as expected. Secondly, it will consume huge page cache, e.g. in mass backup scenario. Thirdly, modern filesystems such as ext4

Re: [Ocfs2-devel] [PATCH 0/9 v6] ocfs2: support append O_DIRECT write

2015-01-20 Thread Joseph Qi
Hi Junxiao, On 2015/1/20 16:26, Junxiao Bi wrote: Hi Joseph, Did this version make any performance improvement with v5? I tested v5, and it didn't improve performance with original buffer write + sync. No performance difference between these two versions. But we have tested with fio before,

[Ocfs2-devel] [PATCH 7/9 v6] ocfs2: complete the rest request through buffer io

2015-01-20 Thread Joseph Qi
Complte the rest request thourgh buffer io after direct write performed. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/file.c | 43 ++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git

[Ocfs2-devel] [PATCH 6/9 v6] ocfs2: do not fallback to buffer I/O write if appending

2015-01-20 Thread Joseph Qi
Now we can do direct io and do not fallback to buffered IO any more in case of append O_DIRECT write. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/file.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/ocfs2/file.c

Re: [Ocfs2-devel] [PATCH 09/17] quota: Make Q_XQUOTASYNC support VFS quota syncing

2015-01-20 Thread Jan Kara
On Mon 19-01-15 01:09:14, Christoph Hellwig wrote: On Fri, Jan 16, 2015 at 01:47:43PM +0100, Jan Kara wrote: Call -quota_sync method from Q_XQUOTASYNC for better userspace compatibility. Q_XQUOTASYNC never did the equivalent to -quota_sync, but rather was the equivalent to sys_syncfs

Re: [Ocfs2-devel] [PATCH 03/17] quota: Add -quota_{enable, disable} callbacks for VFS quotas

2015-01-20 Thread Jan Kara
On Mon 19-01-15 01:02:48, Christoph Hellwig wrote: On Fri, Jan 16, 2015 at 01:47:37PM +0100, Jan Kara wrote: +EXPORT_SYMBOL(dquot_quota_enable); +EXPORT_SYMBOL(dquot_quota_disable); I can't find any modular users of this (in fact none outside this file), so I'd suggest to keep these

Re: [Ocfs2-devel] [PATCH 05/17] ocfs2: Use generic helpers for quotaon and quotaoff

2015-01-20 Thread Jan Kara
On Mon 19-01-15 01:03:47, Christoph Hellwig wrote: On Fri, Jan 16, 2015 at 01:47:39PM +0100, Jan Kara wrote: Ocfs2 can just use the generic helpers provided by quota code for turning quotas on and off when quota files are stored as system inodes. The only difference is the feature test in

Re: [Ocfs2-devel] [PATCH 07/17] quota: Switch -get_dqblk() and -set_dqblk() to use bytes as space units

2015-01-20 Thread Jan Kara
On Mon 19-01-15 01:07:20, Christoph Hellwig wrote: diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index 18dc721ca19f..f718ba1f2ccb 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -559,18 +559,4 @@ typedef struct xfs_swapext /* XFS_IOC_GETFSUUID

Re: [Ocfs2-devel] [PATCH 02/17] quota: Wire up -quota_{enable, disable} callbacks into Q_QUOTA{ON, OFF}

2015-01-20 Thread Jan Kara
On Mon 19-01-15 01:01:21, Christoph Hellwig wrote: On Fri, Jan 16, 2015 at 01:47:36PM +0100, Jan Kara wrote: Make Q_QUOTAON / Q_QUOTAOFF quotactl call -quota_enable / -quota_disable callback when provided. To match current behavior of ocfs2 ext4 we make these quotactls turn on / off quota

Re: [Ocfs2-devel] [PATCH 12/17] xfs: Convert to using -get_state callback

2015-01-20 Thread Jan Kara
On Mon 19-01-15 01:38:10, Christoph Hellwig wrote: +static void xfs_qm_fill_state(struct qc_type_state *tstate, Normal xfs style would be to keep the static void on a separate line, as well as the arguments, e.g. OK, will change it to conform to the XFS coding style. static void