Commit 9a8d5bb4ad829e66ab5428ccdce2cbc8ab0ac96c
Committed by
Linus Torvalds
1 parent
df4927bf6c
Exists in
master
and in
39 other branches
generic swap(): dcache: use swap() instead of private do_switch()
Use the new generic implementation. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 5 additions and 9 deletions Side-by-side Diff
fs/dcache.c
... | ... | @@ -1567,10 +1567,6 @@ |
1567 | 1567 | spin_unlock(&dcache_lock); |
1568 | 1568 | } |
1569 | 1569 | |
1570 | -#define do_switch(x,y) do { \ | |
1571 | - __typeof__ (x) __tmp = x; \ | |
1572 | - x = y; y = __tmp; } while (0) | |
1573 | - | |
1574 | 1570 | /* |
1575 | 1571 | * When switching names, the actual string doesn't strictly have to |
1576 | 1572 | * be preserved in the target - because we're dropping the target |
... | ... | @@ -1589,7 +1585,7 @@ |
1589 | 1585 | /* |
1590 | 1586 | * Both external: swap the pointers |
1591 | 1587 | */ |
1592 | - do_switch(target->d_name.name, dentry->d_name.name); | |
1588 | + swap(target->d_name.name, dentry->d_name.name); | |
1593 | 1589 | } else { |
1594 | 1590 | /* |
1595 | 1591 | * dentry:internal, target:external. Steal target's |
... | ... | @@ -1620,7 +1616,7 @@ |
1620 | 1616 | return; |
1621 | 1617 | } |
1622 | 1618 | } |
1623 | - do_switch(dentry->d_name.len, target->d_name.len); | |
1619 | + swap(dentry->d_name.len, target->d_name.len); | |
1624 | 1620 | } |
1625 | 1621 | |
1626 | 1622 | /* |
... | ... | @@ -1680,7 +1676,7 @@ |
1680 | 1676 | |
1681 | 1677 | /* Switch the names.. */ |
1682 | 1678 | switch_names(dentry, target); |
1683 | - do_switch(dentry->d_name.hash, target->d_name.hash); | |
1679 | + swap(dentry->d_name.hash, target->d_name.hash); | |
1684 | 1680 | |
1685 | 1681 | /* ... and switch the parents */ |
1686 | 1682 | if (IS_ROOT(dentry)) { |
... | ... | @@ -1688,7 +1684,7 @@ |
1688 | 1684 | target->d_parent = target; |
1689 | 1685 | INIT_LIST_HEAD(&target->d_u.d_child); |
1690 | 1686 | } else { |
1691 | - do_switch(dentry->d_parent, target->d_parent); | |
1687 | + swap(dentry->d_parent, target->d_parent); | |
1692 | 1688 | |
1693 | 1689 | /* And add them back to the (new) parent lists */ |
1694 | 1690 | list_add(&target->d_u.d_child, &target->d_parent->d_subdirs); |
... | ... | @@ -1789,7 +1785,7 @@ |
1789 | 1785 | struct dentry *dparent, *aparent; |
1790 | 1786 | |
1791 | 1787 | switch_names(dentry, anon); |
1792 | - do_switch(dentry->d_name.hash, anon->d_name.hash); | |
1788 | + swap(dentry->d_name.hash, anon->d_name.hash); | |
1793 | 1789 | |
1794 | 1790 | dparent = dentry->d_parent; |
1795 | 1791 | aparent = anon->d_parent; |