Theodore Ts'o
26a4c0c6cc
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>
2013-04-03 12:45:17 -04:00
..
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-29 11:13:25 -07:00
2012-12-20 22:34:00 +00:00
2013-03-03 19:36:31 -08:00
2013-03-21 17:59:22 -07:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-07 01:08:55 -08:00
2013-02-27 19:10:24 -08:00
2013-03-09 16:51:13 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-02-27 19:10:24 -08:00
2013-03-13 15:23:44 +01:00
2013-03-11 22:05:56 +01:00
2013-04-03 12:45:17 -04:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-12 18:55:21 -07:00
2013-02-27 19:10:24 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-13 15:47:50 -07:00
2013-03-11 07:09:48 -07:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-12 18:55:21 -07:00
2013-01-14 22:50:45 +01:00
2013-03-11 13:24:56 -04:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-02-28 18:02:55 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-26 14:23:45 -07:00
2013-02-13 06:15:14 -08:00
2013-03-22 16:55:15 -04:00
2013-03-03 19:36:31 -08:00
2013-02-27 19:10:24 -08:00
2013-03-03 19:36:31 -08:00
2013-03-07 01:08:55 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-28 13:43:46 -07:00
2013-02-21 09:38:18 -08:00
2013-03-03 19:36:31 -08:00
2013-03-03 19:36:31 -08:00
2013-03-11 22:05:56 +01:00
2013-02-26 20:16:07 -08:00
2013-03-11 22:05:57 +01:00
2013-03-03 19:36:31 -08:00
2013-03-11 07:09:48 -07:00
2013-03-28 15:52:14 -07:00
2013-03-12 18:55:21 -07:00
2013-03-03 19:36:31 -08:00
2013-03-11 07:09:48 -07:00
2013-03-03 19:36:31 -08:00
2013-03-19 15:17:40 -07:00
2013-02-27 19:10:24 -08:00
2013-02-26 02:46:11 -05:00
2012-12-17 17:15:12 -08:00
2013-02-22 23:31:31 -05:00
2013-02-26 20:16:07 -08:00
2013-03-03 12:06:09 -08:00
2012-12-17 17:15:23 -08:00
2013-02-22 23:31:31 -05:00
2013-03-03 19:36:31 -08:00
2012-12-20 17:40:19 -08:00
2013-01-14 15:00:36 +01:00
2013-02-28 12:52:24 -08:00
2013-02-28 12:52:24 -08:00
2013-02-22 23:31:31 -05:00
2013-03-12 11:05:45 -07:00
2013-02-27 19:10:11 -08:00
2013-03-26 18:25:57 -04:00
2013-02-22 23:31:36 -05:00
2012-12-17 17:15:27 -08:00
2013-01-02 09:16:43 -08:00
2013-02-27 19:10:11 -08:00
2013-02-22 23:31:31 -05:00
2012-12-20 14:04:11 -08:00
2013-03-01 19:48:30 -05:00
2013-02-19 08:42:45 +01:00
2013-03-03 19:36:31 -08:00
2013-03-01 23:51:07 -05:00
2013-02-28 13:21:44 -08:00
2013-02-27 19:10:24 -08:00
2013-03-21 13:11:11 -04:00
2013-02-22 23:31:31 -05:00
2013-01-17 13:08:45 +01:00
2012-12-20 18:46:29 -05:00
2013-02-22 23:31:31 -05:00
2013-03-08 09:03:07 -08:00
2013-03-27 07:50:08 -07:00
2013-03-03 13:23:03 -08:00
2013-03-12 08:29:17 -07:00
2013-03-27 07:50:05 -07:00
2013-03-27 07:50:05 -07:00
2013-03-27 09:24:02 -07:00
2013-02-22 23:31:31 -05:00
2013-02-07 20:51:08 +01:00
2013-03-03 13:23:03 -08:00
2012-12-17 17:15:27 -08:00
2013-03-21 13:11:11 -04:00
2013-02-26 02:46:08 -05:00
2012-12-20 18:50:07 -05:00
2013-02-27 19:10:24 -08:00
2013-02-22 23:31:31 -05:00
2013-03-02 09:35:13 -05:00
2012-12-20 18:50:08 -05:00
2012-12-20 18:50:11 -05:00