ocfs2: implement ocfs2_direct_IO_write
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. [akpm@linux-foundation.org: fix it for "block: Add discard flag to blkdev_issue_zeroout() function"] Signed-off-by: Joseph Qi <joseph.qi@huawei.com> Cc: Weiwei Wang <wangww631@huawei.com> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Xuejiufei <xuejiufei@huawei.com> Cc: alex chen <alex.chen@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
ed460cffc2
commit
24c40b329e
@@ -731,6 +731,16 @@ static inline unsigned int ocfs2_clusters_for_bytes(struct super_block *sb,
|
||||
return clusters;
|
||||
}
|
||||
|
||||
static inline unsigned int ocfs2_bytes_to_clusters(struct super_block *sb,
|
||||
u64 bytes)
|
||||
{
|
||||
int cl_bits = OCFS2_SB(sb)->s_clustersize_bits;
|
||||
unsigned int clusters;
|
||||
|
||||
clusters = (unsigned int)(bytes >> cl_bits);
|
||||
return clusters;
|
||||
}
|
||||
|
||||
static inline u64 ocfs2_blocks_for_bytes(struct super_block *sb,
|
||||
u64 bytes)
|
||||
{
|
||||
|
Reference in New Issue
Block a user