浏览代码

xfs: move node entry counts to xfs_da_geometry

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner 11 年之前
父节点
当前提交
7ab610f9e0
共有 5 个文件被更改,包括 11 次插入16 次删除
  1. 4 4
      fs/xfs/xfs_attr.c
  2. 2 2
      fs/xfs/xfs_da_btree.c
  3. 0 3
      fs/xfs/xfs_dir2.c
  4. 5 5
      fs/xfs/xfs_dir2_node.c
  5. 0 2
      fs/xfs/xfs_mount.h

+ 4 - 4
fs/xfs/xfs_attr.c

@@ -899,7 +899,7 @@ restart:
 	state->args = args;
 	state->args = args;
 	state->mp = mp;
 	state->mp = mp;
 	state->blocksize = state->mp->m_sb.sb_blocksize;
 	state->blocksize = state->mp->m_sb.sb_blocksize;
-	state->node_ents = state->mp->m_attr_node_ents;
+	state->node_ents = args->geo->node_ents;
 
 
 	/*
 	/*
 	 * Search to see if name already exists, and get back a pointer
 	 * Search to see if name already exists, and get back a pointer
@@ -1078,7 +1078,7 @@ restart:
 		state->args = args;
 		state->args = args;
 		state->mp = mp;
 		state->mp = mp;
 		state->blocksize = state->mp->m_sb.sb_blocksize;
 		state->blocksize = state->mp->m_sb.sb_blocksize;
-		state->node_ents = state->mp->m_attr_node_ents;
+		state->node_ents = args->geo->node_ents;
 		state->inleaf = 0;
 		state->inleaf = 0;
 		error = xfs_da3_node_lookup_int(state, &retval);
 		error = xfs_da3_node_lookup_int(state, &retval);
 		if (error)
 		if (error)
@@ -1170,7 +1170,7 @@ xfs_attr_node_removename(xfs_da_args_t *args)
 	state->args = args;
 	state->args = args;
 	state->mp = dp->i_mount;
 	state->mp = dp->i_mount;
 	state->blocksize = state->mp->m_sb.sb_blocksize;
 	state->blocksize = state->mp->m_sb.sb_blocksize;
-	state->node_ents = state->mp->m_attr_node_ents;
+	state->node_ents = args->geo->node_ents;
 
 
 	/*
 	/*
 	 * Search to see if name exists, and get back a pointer to it.
 	 * Search to see if name exists, and get back a pointer to it.
@@ -1433,7 +1433,7 @@ xfs_attr_node_get(xfs_da_args_t *args)
 	state->args = args;
 	state->args = args;
 	state->mp = args->dp->i_mount;
 	state->mp = args->dp->i_mount;
 	state->blocksize = state->mp->m_sb.sb_blocksize;
 	state->blocksize = state->mp->m_sb.sb_blocksize;
-	state->node_ents = state->mp->m_attr_node_ents;
+	state->node_ents = args->geo->node_ents;
 
 
 	/*
 	/*
 	 * Search to see if name exists, and get back a pointer to it.
 	 * Search to see if name exists, and get back a pointer to it.

+ 2 - 2
fs/xfs/xfs_da_btree.c

@@ -167,8 +167,8 @@ xfs_da3_node_verify(
 	 * we don't know if the node is for and attribute or directory tree,
 	 * we don't know if the node is for and attribute or directory tree,
 	 * so only fail if the count is outside both bounds
 	 * so only fail if the count is outside both bounds
 	 */
 	 */
-	if (ichdr.count > mp->m_dir_node_ents &&
-	    ichdr.count > mp->m_attr_node_ents)
+	if (ichdr.count > mp->m_dir_geo->node_ents &&
+	    ichdr.count > mp->m_attr_geo->node_ents)
 		return false;
 		return false;
 
 
 	/* XXX: hash order check? */
 	/* XXX: hash order check? */

+ 0 - 3
fs/xfs/xfs_dir2.c

@@ -144,9 +144,6 @@ xfs_da_mount(
 	else
 	else
 		mp->m_dirnameops = &xfs_default_nameops;
 		mp->m_dirnameops = &xfs_default_nameops;
 
 
-	/* XXX: these are to be removed as code is converted to use geo */
-	mp->m_dir_node_ents = mp->m_dir_geo->node_ents;
-	mp->m_attr_node_ents = mp->m_attr_geo->node_ents;
 	return 0;
 	return 0;
 }
 }
 
 

+ 5 - 5
fs/xfs/xfs_dir2_node.c

@@ -1596,8 +1596,8 @@ xfs_dir2_node_addname(
 	state = xfs_da_state_alloc();
 	state = xfs_da_state_alloc();
 	state->args = args;
 	state->args = args;
 	state->mp = args->dp->i_mount;
 	state->mp = args->dp->i_mount;
-	state->blocksize = state->args->geo->blksize;
-	state->node_ents = state->mp->m_dir_node_ents;
+	state->blocksize = args->geo->blksize;
+	state->node_ents = args->geo->node_ents;
 	/*
 	/*
 	 * Look up the name.  We're not supposed to find it, but
 	 * Look up the name.  We're not supposed to find it, but
 	 * this gives us the insertion point.
 	 * this gives us the insertion point.
@@ -2043,7 +2043,7 @@ xfs_dir2_node_lookup(
 	state->args = args;
 	state->args = args;
 	state->mp = args->dp->i_mount;
 	state->mp = args->dp->i_mount;
 	state->blocksize = args->geo->blksize;
 	state->blocksize = args->geo->blksize;
-	state->node_ents = state->mp->m_dir_node_ents;
+	state->node_ents = args->geo->node_ents;
 	/*
 	/*
 	 * Fill in the path to the entry in the cursor.
 	 * Fill in the path to the entry in the cursor.
 	 */
 	 */
@@ -2098,7 +2098,7 @@ xfs_dir2_node_removename(
 	state->args = args;
 	state->args = args;
 	state->mp = args->dp->i_mount;
 	state->mp = args->dp->i_mount;
 	state->blocksize = args->geo->blksize;
 	state->blocksize = args->geo->blksize;
-	state->node_ents = state->mp->m_dir_node_ents;
+	state->node_ents = args->geo->node_ents;
 
 
 	/* Look up the entry we're deleting, set up the cursor. */
 	/* Look up the entry we're deleting, set up the cursor. */
 	error = xfs_da3_node_lookup_int(state, &rval);
 	error = xfs_da3_node_lookup_int(state, &rval);
@@ -2168,7 +2168,7 @@ xfs_dir2_node_replace(
 	state->args = args;
 	state->args = args;
 	state->mp = args->dp->i_mount;
 	state->mp = args->dp->i_mount;
 	state->blocksize = args->geo->blksize;
 	state->blocksize = args->geo->blksize;
-	state->node_ents = state->mp->m_dir_node_ents;
+	state->node_ents = args->geo->node_ents;
 	inum = args->inumber;
 	inum = args->inumber;
 	/*
 	/*
 	 * Lookup the entry to change in the btree.
 	 * Lookup the entry to change in the btree.

+ 0 - 2
fs/xfs/xfs_mount.h

@@ -134,8 +134,6 @@ typedef struct xfs_mount {
 	int			m_fixedfsid[2];	/* unchanged for life of FS */
 	int			m_fixedfsid[2];	/* unchanged for life of FS */
 	uint			m_dmevmask;	/* DMI events for this FS */
 	uint			m_dmevmask;	/* DMI events for this FS */
 	__uint64_t		m_flags;	/* global mount flags */
 	__uint64_t		m_flags;	/* global mount flags */
-	uint			m_dir_node_ents; /* #entries in a dir danode */
-	uint			m_attr_node_ents; /* #entries in attr danode */
 	int			m_ialloc_inos;	/* inodes in inode allocation */
 	int			m_ialloc_inos;	/* inodes in inode allocation */
 	int			m_ialloc_blks;	/* blocks in inode allocation */
 	int			m_ialloc_blks;	/* blocks in inode allocation */
 	int			m_inoalign_mask;/* mask sb_inoalignmt if used */
 	int			m_inoalign_mask;/* mask sb_inoalignmt if used */