Skip to content

Commit 65dd832

Browse files
wangxiaoguangtytso
authored andcommitted
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>
1 parent 0ff8947 commit 65dd832

File tree

1 file changed

+6
-53
lines changed

1 file changed

+6
-53
lines changed

fs/ext4/move_extent.c

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -119,34 +119,13 @@ mext_check_coverage(struct inode *inode, ext4_lblk_t from, ext4_lblk_t count,
119119
return ret;
120120
}
121121

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-
144122
/**
145123
* mext_page_double_lock - Grab and lock pages on both @inode1 and @inode2
146124
*
147125
* @inode1: the inode structure
148126
* @inode2: the inode structure
149-
* @index: page index
127+
* @index1: page index
128+
* @index2: page index
150129
* @page: result page vector
151130
*
152131
* Grab two locked pages for inode's by inode order
@@ -266,13 +245,14 @@ mext_page_mkuptodate(struct page *page, unsigned from, unsigned to)
266245
* @o_filp: file structure of original file
267246
* @donor_inode: donor inode
268247
* @orig_page_offset: page index on original file
248+
* @donor_page_offset: page index on donor file
269249
* @data_offset_in_page: block index where data swapping starts
270250
* @block_len_in_page: the number of blocks to be swapped
271251
* @unwritten: orig extent is unwritten or not
272252
* @err: pointer to save return value
273253
*
274254
* 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().
276256
* Finally, write out the saved data in new original inode blocks. Return
277257
* replaced block count.
278258
*/
@@ -551,41 +531,14 @@ mext_check_arguments(struct inode *orig_inode,
551531
*
552532
* @o_filp: file structure of the original file
553533
* @d_filp: file structure of the donor file
554-
* @orig_start: start offset in block for orig
555-
* @donor_start: start offset in block for donor
534+
* @orig_blk: start offset in block for orig
535+
* @donor_blk: start offset in block for donor
556536
* @len: the number of blocks to be moved
557537
* @moved_len: moved block length
558538
*
559539
* This function returns 0 and moved block length is set in moved_len
560540
* if succeed, otherwise returns error value.
561541
*
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.
589542
*/
590543
int
591544
ext4_move_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,

0 commit comments

Comments
 (0)