]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: move generic_write_checks() before the alignment checks
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 9 Apr 2015 15:14:45 +0000 (11:14 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 12 Apr 2015 02:30:21 +0000 (22:30 -0400)
commitcd1198170b39804e3a9017d1f4ae9b06d5a26a7d
treeff55161fcd96c35d3ec568161302c2605334c36b
parent785af7ed86d8ee6a77d5a784036210acf9213192
ocfs2: move generic_write_checks() before the alignment checks

Alignment checks for dio depend upon the range truncation done by
generic_write_checks().  They can be done as soon as we got ocfs2_rw_lock()
and that actually makes ocfs2_prepare_inode_for_write() simpler.

The only thing to watch out for is restoring the original count
in "unlock and redo without dio" case.  Position doesn't need to be
restored, since we change it only in O_APPEND case and in that case it
will be reassigned anyway.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ocfs2/file.c