ext4: use swap() in mext_page_double_lock()
authorFabian Frederick <fabf@skynet.be>
Sat, 13 Jun 2015 03:47:33 +0000 (23:47 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 13 Jun 2015 03:47:33 +0000 (23:47 -0400)
Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/move_extent.c

index 370420bfae8d76aaf7f68d21cfb5f1c06cf7770c..8c04afb90b1b17a502ea3068d37c25f30f31b7a3 100644 (file)
@@ -166,12 +166,9 @@ mext_page_double_lock(struct inode *inode1, struct inode *inode2,
         */
        wait_on_page_writeback(page[0]);
        wait_on_page_writeback(page[1]);
-       if (inode1 > inode2) {
-               struct page *tmp;
-               tmp = page[0];
-               page[0] = page[1];
-               page[1] = tmp;
-       }
+       if (inode1 > inode2)
+               swap(page[0], page[1]);
+
        return 0;
 }