@@ -1506,21 +1506,20 @@ xfs_da3_fixhashpath(
15061506}
15071507
15081508/*
1509- * Remove an entry from an intermediate node.
1509+ * Internal implementation to remove an entry from an intermediate node.
15101510 */
15111511STATIC void
1512- xfs_da3_node_remove (
1513- struct xfs_da_state * state ,
1514- struct xfs_da_state_blk * drop_blk )
1512+ __xfs_da3_node_remove (
1513+ struct xfs_trans * tp ,
1514+ struct xfs_inode * dp ,
1515+ struct xfs_da_geometry * geo ,
1516+ struct xfs_da_state_blk * drop_blk )
15151517{
15161518 struct xfs_da_intnode * node ;
15171519 struct xfs_da3_icnode_hdr nodehdr ;
15181520 struct xfs_da_node_entry * btree ;
15191521 int index ;
15201522 int tmp ;
1521- struct xfs_inode * dp = state -> args -> dp ;
1522-
1523- trace_xfs_da_node_remove (state -> args );
15241523
15251524 node = drop_blk -> bp -> b_addr ;
15261525 xfs_da3_node_hdr_from_disk (dp -> i_mount , & nodehdr , node );
@@ -1536,24 +1535,56 @@ xfs_da3_node_remove(
15361535 tmp = nodehdr .count - index - 1 ;
15371536 tmp *= (uint )sizeof (xfs_da_node_entry_t );
15381537 memmove (& btree [index ], & btree [index + 1 ], tmp );
1539- xfs_trans_log_buf (state -> args -> trans , drop_blk -> bp ,
1538+ xfs_trans_log_buf (tp , drop_blk -> bp ,
15401539 XFS_DA_LOGRANGE (node , & btree [index ], tmp ));
15411540 index = nodehdr .count - 1 ;
15421541 }
15431542 memset (& btree [index ], 0 , sizeof (xfs_da_node_entry_t ));
1544- xfs_trans_log_buf (state -> args -> trans , drop_blk -> bp ,
1543+ xfs_trans_log_buf (tp , drop_blk -> bp ,
15451544 XFS_DA_LOGRANGE (node , & btree [index ], sizeof (btree [index ])));
15461545 nodehdr .count -= 1 ;
15471546 xfs_da3_node_hdr_to_disk (dp -> i_mount , node , & nodehdr );
1548- xfs_trans_log_buf (state -> args -> trans , drop_blk -> bp ,
1549- XFS_DA_LOGRANGE (node , & node -> hdr , state -> args -> geo -> node_hdr_size ));
1547+ xfs_trans_log_buf (tp , drop_blk -> bp ,
1548+ XFS_DA_LOGRANGE (node , & node -> hdr , geo -> node_hdr_size ));
15501549
15511550 /*
15521551 * Copy the last hash value from the block to propagate upwards.
15531552 */
15541553 drop_blk -> hashval = be32_to_cpu (btree [index - 1 ].hashval );
15551554}
15561555
1556+ /*
1557+ * Remove an entry from an intermediate node.
1558+ */
1559+ STATIC void
1560+ xfs_da3_node_remove (
1561+ struct xfs_da_state * state ,
1562+ struct xfs_da_state_blk * drop_blk )
1563+ {
1564+ trace_xfs_da_node_remove (state -> args );
1565+
1566+ __xfs_da3_node_remove (state -> args -> trans , state -> args -> dp ,
1567+ state -> args -> geo , drop_blk );
1568+ }
1569+
1570+ /*
1571+ * Remove an entry from an intermediate attr node at the specified index.
1572+ */
1573+ void
1574+ xfs_attr3_node_entry_remove (
1575+ struct xfs_trans * tp ,
1576+ struct xfs_inode * dp ,
1577+ struct xfs_buf * bp ,
1578+ int index )
1579+ {
1580+ struct xfs_da_state_blk blk = {
1581+ .index = index ,
1582+ .bp = bp ,
1583+ };
1584+
1585+ __xfs_da3_node_remove (tp , dp , dp -> i_mount -> m_attr_geo , & blk );
1586+ }
1587+
15571588/*
15581589 * Unbalance the elements between two intermediate nodes,
15591590 * move all Btree elements from one node into another.
0 commit comments