@@ -119,34 +119,13 @@ mext_check_coverage(struct inode *inode, ext4_lblk_t from, ext4_lblk_t count,
119
119
return ret ;
120
120
}
121
121
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
122
/**
145
123
* mext_page_double_lock - Grab and lock pages on both @inode1 and @inode2
146
124
*
147
125
* @inode1: the inode structure
148
126
* @inode2: the inode structure
149
- * @index: page index
127
+ * @index1: page index
128
+ * @index2: page index
150
129
* @page: result page vector
151
130
*
152
131
* Grab two locked pages for inode's by inode order
@@ -266,13 +245,14 @@ mext_page_mkuptodate(struct page *page, unsigned from, unsigned to)
266
245
* @o_filp: file structure of original file
267
246
* @donor_inode: donor inode
268
247
* @orig_page_offset: page index on original file
248
+ * @donor_page_offset: page index on donor file
269
249
* @data_offset_in_page: block index where data swapping starts
270
250
* @block_len_in_page: the number of blocks to be swapped
271
251
* @unwritten: orig extent is unwritten or not
272
252
* @err: pointer to save return value
273
253
*
274
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
256
* Finally, write out the saved data in new original inode blocks. Return
277
257
* replaced block count.
278
258
*/
@@ -551,41 +531,14 @@ mext_check_arguments(struct inode *orig_inode,
551
531
*
552
532
* @o_filp: file structure of the original file
553
533
* @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
556
536
* @len: the number of blocks to be moved
557
537
* @moved_len: moved block length
558
538
*
559
539
* This function returns 0 and moved block length is set in moved_len
560
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
543
int
591
544
ext4_move_extents (struct file * o_filp , struct file * d_filp , __u64 orig_blk ,
0 commit comments