提交 16823104 编写于 作者: C Christoph Hellwig 提交者: Darrick J. Wong

xfs: remove the data_dot_offset field in struct xfs_dir_ops

The data_dot_offset value is always equal to data_entry_offset given
that "." is always the first entry in the directory.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 c81484e2
...@@ -204,7 +204,6 @@ static const struct xfs_dir_ops xfs_dir2_ops = { ...@@ -204,7 +204,6 @@ static const struct xfs_dir_ops xfs_dir2_ops = {
.data_entry_tag_p = xfs_dir2_data_entry_tag_p, .data_entry_tag_p = xfs_dir2_data_entry_tag_p,
.data_bestfree_p = xfs_dir2_data_bestfree_p, .data_bestfree_p = xfs_dir2_data_bestfree_p,
.data_dot_offset = sizeof(struct xfs_dir2_data_hdr),
.data_dotdot_offset = sizeof(struct xfs_dir2_data_hdr) + .data_dotdot_offset = sizeof(struct xfs_dir2_data_hdr) +
XFS_DIR2_DATA_ENTSIZE(1), XFS_DIR2_DATA_ENTSIZE(1),
.data_first_offset = sizeof(struct xfs_dir2_data_hdr) + .data_first_offset = sizeof(struct xfs_dir2_data_hdr) +
...@@ -225,7 +224,6 @@ static const struct xfs_dir_ops xfs_dir2_ftype_ops = { ...@@ -225,7 +224,6 @@ static const struct xfs_dir_ops xfs_dir2_ftype_ops = {
.data_entry_tag_p = xfs_dir3_data_entry_tag_p, .data_entry_tag_p = xfs_dir3_data_entry_tag_p,
.data_bestfree_p = xfs_dir2_data_bestfree_p, .data_bestfree_p = xfs_dir2_data_bestfree_p,
.data_dot_offset = sizeof(struct xfs_dir2_data_hdr),
.data_dotdot_offset = sizeof(struct xfs_dir2_data_hdr) + .data_dotdot_offset = sizeof(struct xfs_dir2_data_hdr) +
XFS_DIR3_DATA_ENTSIZE(1), XFS_DIR3_DATA_ENTSIZE(1),
.data_first_offset = sizeof(struct xfs_dir2_data_hdr) + .data_first_offset = sizeof(struct xfs_dir2_data_hdr) +
...@@ -246,7 +244,6 @@ static const struct xfs_dir_ops xfs_dir3_ops = { ...@@ -246,7 +244,6 @@ static const struct xfs_dir_ops xfs_dir3_ops = {
.data_entry_tag_p = xfs_dir3_data_entry_tag_p, .data_entry_tag_p = xfs_dir3_data_entry_tag_p,
.data_bestfree_p = xfs_dir3_data_bestfree_p, .data_bestfree_p = xfs_dir3_data_bestfree_p,
.data_dot_offset = sizeof(struct xfs_dir3_data_hdr),
.data_dotdot_offset = sizeof(struct xfs_dir3_data_hdr) + .data_dotdot_offset = sizeof(struct xfs_dir3_data_hdr) +
XFS_DIR3_DATA_ENTSIZE(1), XFS_DIR3_DATA_ENTSIZE(1),
.data_first_offset = sizeof(struct xfs_dir3_data_hdr) + .data_first_offset = sizeof(struct xfs_dir3_data_hdr) +
......
...@@ -40,7 +40,6 @@ struct xfs_dir_ops { ...@@ -40,7 +40,6 @@ struct xfs_dir_ops {
struct xfs_dir2_data_free * struct xfs_dir2_data_free *
(*data_bestfree_p)(struct xfs_dir2_data_hdr *hdr); (*data_bestfree_p)(struct xfs_dir2_data_hdr *hdr);
xfs_dir2_data_aoff_t data_dot_offset;
xfs_dir2_data_aoff_t data_dotdot_offset; xfs_dir2_data_aoff_t data_dotdot_offset;
xfs_dir2_data_aoff_t data_first_offset; xfs_dir2_data_aoff_t data_first_offset;
size_t data_entry_offset; size_t data_entry_offset;
......
...@@ -70,13 +70,12 @@ xfs_dir2_sf_getdents( ...@@ -70,13 +70,12 @@ xfs_dir2_sf_getdents(
return 0; return 0;
/* /*
* Precalculate offsets for . and .. as we will always need them. * Precalculate offsets for "." and ".." as we will always need them.
* * This relies on the fact that directories always start with the
* XXX(hch): the second argument is sometimes 0 and sometimes * entries for "." and "..".
* geo->datablk
*/ */
dot_offset = xfs_dir2_db_off_to_dataptr(geo, geo->datablk, dot_offset = xfs_dir2_db_off_to_dataptr(geo, geo->datablk,
dp->d_ops->data_dot_offset); dp->d_ops->data_entry_offset);
dotdot_offset = xfs_dir2_db_off_to_dataptr(geo, geo->datablk, dotdot_offset = xfs_dir2_db_off_to_dataptr(geo, geo->datablk,
dp->d_ops->data_dotdot_offset); dp->d_ops->data_dotdot_offset);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册