diff options
author | Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com> | 2014-10-11 19:56:34 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-10-11 19:56:34 -0400 |
commit | 65dd8327eb055a393a413a2214f70a9a10ff7ad6 (patch) | |
tree | 212723fb4e90a8dd444cef2ff4dfc341b13a9147 /fs/ext4/move_extent.c | |
parent | 0ff8947fc5f700172b37cbca811a38eb9cb81e08 (diff) |
ext4: delete useless comments about ext4_move_extents
In patch 'ext4: refactor ext4_move_extents code base', Dmitry Monakhov has
refactored ext4_move_extents' implementation, but forgot to update the
corresponding comments, this patch will try to delete some useless comments.
Reviewed-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/move_extent.c')
-rw-r--r-- | fs/ext4/move_extent.c | 59 |
1 files changed, 6 insertions, 53 deletions
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index 5d7806390102..9f2311bc9c4f 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c | |||
@@ -120,33 +120,12 @@ out: | |||
120 | } | 120 | } |
121 | 121 | ||
122 | /** | 122 | /** |
123 | * mext_replace_branches - Replace original extents with new extents | ||
124 | * | ||
125 | * @handle: journal handle | ||
126 | * @orig_inode: original inode | ||
127 | * @donor_inode: donor inode | ||
128 | * @from: block offset of orig_inode | ||
129 | * @count: block count to be replaced | ||
130 | * @err: pointer to save return value | ||
131 | * | ||
132 | * Replace original inode extents and donor inode extents page by page. | ||
133 | * We implement this replacement in the following three steps: | ||
134 | * 1. Save the block information of original and donor inodes into | ||
135 | * dummy extents. | ||
136 | * 2. Change the block information of original inode to point at the | ||
137 | * donor inode blocks. | ||
138 | * 3. Change the block information of donor inode to point at the saved | ||
139 | * original inode blocks in the dummy extents. | ||
140 | * | ||
141 | * Return replaced block count. | ||
142 | */ | ||
143 | |||
144 | /** | ||
145 | * mext_page_double_lock - Grab and lock pages on both @inode1 and @inode2 | 123 | * mext_page_double_lock - Grab and lock pages on both @inode1 and @inode2 |
146 | * | 124 | * |
147 | * @inode1: the inode structure | 125 | * @inode1: the inode structure |
148 | * @inode2: the inode structure | 126 | * @inode2: the inode structure |
149 | * @index: page index | 127 | * @index1: page index |
128 | * @index2: page index | ||
150 | * @page: result page vector | 129 | * @page: result page vector |
151 | * | 130 | * |
152 | * Grab two locked pages for inode's by inode order | 131 | * Grab two locked pages for inode's by inode order |
@@ -266,13 +245,14 @@ out: | |||
266 | * @o_filp: file structure of original file | 245 | * @o_filp: file structure of original file |
267 | * @donor_inode: donor inode | 246 | * @donor_inode: donor inode |
268 | * @orig_page_offset: page index on original file | 247 | * @orig_page_offset: page index on original file |
248 | * @donor_page_offset: page index on donor file | ||
269 | * @data_offset_in_page: block index where data swapping starts | 249 | * @data_offset_in_page: block index where data swapping starts |
270 | * @block_len_in_page: the number of blocks to be swapped | 250 | * @block_len_in_page: the number of blocks to be swapped |
271 | * @unwritten: orig extent is unwritten or not | 251 | * @unwritten: orig extent is unwritten or not |
272 | * @err: pointer to save return value | 252 | * @err: pointer to save return value |
273 | * | 253 | * |
274 | * Save the data in original inode blocks and replace original inode extents | 254 | * Save the data in original inode blocks and replace original inode extents |
275 | * with donor inode extents by calling mext_replace_branches(). | 255 | * with donor inode extents by calling ext4_swap_extents(). |
276 | * Finally, write out the saved data in new original inode blocks. Return | 256 | * Finally, write out the saved data in new original inode blocks. Return |
277 | * replaced block count. | 257 | * replaced block count. |
278 | */ | 258 | */ |
@@ -551,41 +531,14 @@ mext_check_arguments(struct inode *orig_inode, | |||
551 | * | 531 | * |
552 | * @o_filp: file structure of the original file | 532 | * @o_filp: file structure of the original file |
553 | * @d_filp: file structure of the donor file | 533 | * @d_filp: file structure of the donor file |
554 | * @orig_start: start offset in block for orig | 534 | * @orig_blk: start offset in block for orig |
555 | * @donor_start: start offset in block for donor | 535 | * @donor_blk: start offset in block for donor |
556 | * @len: the number of blocks to be moved | 536 | * @len: the number of blocks to be moved |
557 | * @moved_len: moved block length | 537 | * @moved_len: moved block length |
558 | * | 538 | * |
559 | * This function returns 0 and moved block length is set in moved_len | 539 | * This function returns 0 and moved block length is set in moved_len |
560 | * if succeed, otherwise returns error value. | 540 | * if succeed, otherwise returns error value. |
561 | * | 541 | * |
562 | * Note: ext4_move_extents() proceeds the following order. | ||
563 | * 1:ext4_move_extents() calculates the last block number of moving extent | ||
564 | * function by the start block number (orig_start) and the number of blocks | ||
565 | * to be moved (len) specified as arguments. | ||
566 | * If the {orig, donor}_start points a hole, the extent's start offset | ||
567 | * pointed by ext_cur (current extent), holecheck_path, orig_path are set | ||
568 | * after hole behind. | ||
569 | * 2:Continue step 3 to step 5, until the holecheck_path points to last_extent | ||
570 | * or the ext_cur exceeds the block_end which is last logical block number. | ||
571 | * 3:To get the length of continues area, call mext_next_extent() | ||
572 | * specified with the ext_cur (initial value is holecheck_path) re-cursive, | ||
573 | * until find un-continuous extent, the start logical block number exceeds | ||
574 | * the block_end or the extent points to the last extent. | ||
575 | * 4:Exchange the original inode data with donor inode data | ||
576 | * from orig_page_offset to seq_end_page. | ||
577 | * The start indexes of data are specified as arguments. | ||
578 | * That of the original inode is orig_page_offset, | ||
579 | * and the donor inode is also orig_page_offset | ||
580 | * (To easily handle blocksize != pagesize case, the offset for the | ||
581 | * donor inode is block unit). | ||
582 | * 5:Update holecheck_path and orig_path to points a next proceeding extent, | ||
583 | * then returns to step 2. | ||
584 | * 6:Release holecheck_path, orig_path and set the len to moved_len | ||
585 | * which shows the number of moved blocks. | ||
586 | * The moved_len is useful for the command to calculate the file offset | ||
587 | * for starting next move extent ioctl. | ||
588 | * 7:Return 0 on success, or a negative error value on failure. | ||
589 | */ | 542 | */ |
590 | int | 543 | int |
591 | ext4_move_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk, | 544 | ext4_move_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk, |