Ryan Ding b46637d59f ocfs2: use c_new to indicate newly allocated extents
To support direct io in ocfs2_write_begin_nolock & ocfs2_write_end_nolock.

There is a problem in ocfs2's direct io implement: if system crashed
after extents allocated, and before data return, we will get a extent
with dirty data on disk.  This problem violate the journal=order
semantics, which means meta changes take effect after data written to
disk.  To resolve this issue, direct write can use the UNWRITTEN flag to
describe a extent during direct data writeback.  The direct write
procedure should act in the following order:

phase 1: alloc extent with UNWRITTEN flag
phase 2: submit direct data to disk, add zero page to page cache
phase 3: clear UNWRITTEN flag when data has been written to disk

This patch is to change the 'c_unwritten' member of
ocfs2_write_cluster_desc to 'c_clear_unwritten'.  Means whether to clear
the unwritten flag.  It do not care if a extent is allocated or not.
And use 'c_new' to specify a newly allocated extent.  So the direct io
procedure can use c_clear_unwritten to control the UNWRITTEN bit on
extent.

Signed-off-by: Ryan Ding <ryan.ding@oracle.com>
Reviewed-by: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-03-25 16:37:42 -07:00
..
2016-01-22 18:04:28 -05:00
2016-01-20 17:09:18 -08:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-03-17 16:38:36 -07:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-03-17 16:51:32 -07:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-03-24 19:57:15 -07:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2015-11-13 21:53:18 -08:00
2016-01-22 18:04:28 -05:00
2016-03-20 21:37:46 +01:00
2016-01-22 18:04:28 -05:00
2014-11-19 13:01:20 -05:00
2015-11-10 12:07:22 -08:00
2016-02-27 10:28:52 -08:00
2016-01-22 18:04:28 -05:00
2016-03-15 16:55:16 -07:00
2016-03-21 11:53:05 -07:00
2016-03-14 00:17:38 -04:00
2016-03-21 11:53:05 -07:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-03-14 00:16:33 -04:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2014-08-26 09:35:56 +02:00
2016-01-22 18:04:28 -05:00