diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-04-03 16:45:17 (GMT) |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-04-03 16:45:17 (GMT) |
commit | 26a4c0c6ccecf6814cf44f951c97222bd795bc1a (patch) | |
tree | 9b3a2fa02c61464ead1456499cad46e41644878b /sound/pci/sis7019.h | |
parent | 781f143ea0fd7981ebe2e8cd96114997c8cf6c07 (diff) | |
download | linux-26a4c0c6ccecf6814cf44f951c97222bd795bc1a.tar.xz |
ext4: refactor punch hole code
Move common code in ext4_ind_punch_hole() and ext4_ext_punch_hole()
into ext4_punch_hole(). This saves over 150 lines of code.
This also fixes a potential bug when the punch_hole() code is racing
against indirect-to-extents or extents-to-indirect migation. We are
currently using i_mutex to protect against changes to the inode flag;
specifically, the append-only, immutable, and extents inode flags. So
we need to take i_mutex before deciding whether to use the
extents-specific or indirect-specific punch_hole code.
Also, there was a missing call to ext4_inode_block_unlocked_dio() in
the indirect punch codepath. This was added in commit 02d262dffcf4c
to block DIO readers racing against the punch operation in the
codepath for extent-mapped inodes, but it was missing for
indirect-block mapped inodes. One of the advantages of refactoring
the code is that it makes such oversights much less likely.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'sound/pci/sis7019.h')
0 files changed, 0 insertions, 0 deletions