Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'xfs-5.16-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs cleanups from Darrick Wong:
"The most 'exciting' aspect of this branch is that the xfsprogs
maintainer and I have worked through the last of the code
discrepancies between kernel and userspace libxfs such that there are
no code differences between the two except for #includes.

IOWs, diff suffices to demonstrate that the userspace tools behave the
same as the kernel, and kernel-only bits are clearly marked in the
/kernel/ source code instead of just the userspace source.

Summary:

- Clean up open-coded swap() calls.

- A little bit of #ifdef golf to complete the reunification of the
kernel and userspace libxfs source code"

* tag 'xfs-5.16-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: sync xfs_btree_split macros with userspace libxfs
xfs: #ifdef out perag code for userspace
xfs: use swap() to make dabtree code cleaner

+12 -7
+2
fs/xfs/libxfs/xfs_ag.c
··· 248 248 spin_unlock(&mp->m_perag_lock); 249 249 radix_tree_preload_end(); 250 250 251 + #ifdef __KERNEL__ 251 252 /* Place kernel structure only init below this point. */ 252 253 spin_lock_init(&pag->pag_ici_lock); 253 254 spin_lock_init(&pag->pagb_lock); ··· 258 257 init_waitqueue_head(&pag->pagb_wait); 259 258 pag->pagb_count = 0; 260 259 pag->pagb_tree = RB_ROOT; 260 + #endif /* __KERNEL__ */ 261 261 262 262 error = xfs_buf_hash_init(pag); 263 263 if (error)
+5 -3
fs/xfs/libxfs/xfs_ag.h
··· 64 64 /* Blocks reserved for the reverse mapping btree. */ 65 65 struct xfs_ag_resv pag_rmapbt_resv; 66 66 67 + /* for rcu-safe freeing */ 68 + struct rcu_head rcu_head; 69 + 70 + #ifdef __KERNEL__ 67 71 /* -- kernel only structures below this line -- */ 68 72 69 73 /* ··· 94 90 spinlock_t pag_buf_lock; /* lock for pag_buf_hash */ 95 91 struct rhashtable pag_buf_hash; 96 92 97 - /* for rcu-safe freeing */ 98 - struct rcu_head rcu_head; 99 - 100 93 /* background prealloc block trimming */ 101 94 struct delayed_work pag_blockgc_work; 102 95 ··· 103 102 * or have some other means to control concurrency. 104 103 */ 105 104 struct rhashtable pagi_unlinked_hash; 105 + #endif /* __KERNEL__ */ 106 106 }; 107 107 108 108 int xfs_initialize_perag(struct xfs_mount *mp, xfs_agnumber_t agcount,
+4
fs/xfs/libxfs/xfs_btree.c
··· 2785 2785 return error; 2786 2786 } 2787 2787 2788 + #ifdef __KERNEL__ 2788 2789 struct xfs_btree_split_args { 2789 2790 struct xfs_btree_cur *cur; 2790 2791 int level; ··· 2871 2870 destroy_work_on_stack(&args.work); 2872 2871 return args.result; 2873 2872 } 2873 + #else 2874 + #define xfs_btree_split __xfs_btree_split 2875 + #endif /* __KERNEL__ */ 2874 2876 2875 2877 2876 2878 /*
+1 -4
fs/xfs/libxfs/xfs_da_btree.c
··· 864 864 { 865 865 struct xfs_da_intnode *node1; 866 866 struct xfs_da_intnode *node2; 867 - struct xfs_da_intnode *tmpnode; 868 867 struct xfs_da_node_entry *btree1; 869 868 struct xfs_da_node_entry *btree2; 870 869 struct xfs_da_node_entry *btree_s; ··· 893 894 ((be32_to_cpu(btree2[0].hashval) < be32_to_cpu(btree1[0].hashval)) || 894 895 (be32_to_cpu(btree2[nodehdr2.count - 1].hashval) < 895 896 be32_to_cpu(btree1[nodehdr1.count - 1].hashval)))) { 896 - tmpnode = node1; 897 - node1 = node2; 898 - node2 = tmpnode; 897 + swap(node1, node2); 899 898 xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr1, node1); 900 899 xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr2, node2); 901 900 btree1 = nodehdr1.btree;