From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 06/15] xfs: remove the never fully implemented UUID fork format
Date: Thu, 19 Oct 2017 15:48:13 -0700 [thread overview]
Message-ID: <20171019224813.GP4755@magnolia> (raw)
In-Reply-To: <20171019065942.18813-7-hch@lst.de>
On Thu, Oct 19, 2017 at 08:59:33AM +0200, Christoph Hellwig wrote:
> Remove the dead code dealing with the UUID fork format that was never
> implemented in Linux (and neither in IRIX as far as I know).
I think I need a little more context on this -- for what purpose was the
UUID format created, and has it ever been used anywhere? When I was
working on the ifork verifiers/scrub I noticed that we'd never actually
accept anything with that format.
(I'm ok with removing it, I just want to know what I'm killing before I
commit to it.)
--D
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/xfs/libxfs/xfs_attr_leaf.c | 6 +-----
> fs/xfs/libxfs/xfs_bmap.c | 4 ----
> fs/xfs/libxfs/xfs_format.h | 2 +-
> fs/xfs/libxfs/xfs_inode_fork.c | 9 ---------
> fs/xfs/libxfs/xfs_inode_fork.h | 1 -
> fs/xfs/libxfs/xfs_log_format.h | 20 ++++++++++----------
> fs/xfs/xfs_inode_item.c | 25 ++++++-------------------
> fs/xfs/xfs_itable.c | 1 -
> fs/xfs/xfs_log_recover.c | 10 +---------
> 9 files changed, 19 insertions(+), 59 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> index 5c16db86b38f..53cc8b986eac 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
> @@ -397,13 +397,9 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes)
> /* rounded down */
> offset = (XFS_LITINO(mp, dp->i_d.di_version) - bytes) >> 3;
>
> - switch (dp->i_d.di_format) {
> - case XFS_DINODE_FMT_DEV:
> + if (dp->i_d.di_format == XFS_DINODE_FMT_DEV) {
> minforkoff = roundup(sizeof(xfs_dev_t), 8) >> 3;
> return (offset >= minforkoff) ? minforkoff : 0;
> - case XFS_DINODE_FMT_UUID:
> - minforkoff = roundup(sizeof(uuid_t), 8) >> 3;
> - return (offset >= minforkoff) ? minforkoff : 0;
> }
>
> /*
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 6431386f4676..22e7578e5696 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -231,7 +231,6 @@ xfs_bmap_forkoff_reset(
> {
> if (whichfork == XFS_ATTR_FORK &&
> ip->i_d.di_format != XFS_DINODE_FMT_DEV &&
> - ip->i_d.di_format != XFS_DINODE_FMT_UUID &&
> ip->i_d.di_format != XFS_DINODE_FMT_BTREE) {
> uint dfl_forkoff = xfs_default_attroffset(ip) >> 3;
>
> @@ -1086,9 +1085,6 @@ xfs_bmap_add_attrfork(
> case XFS_DINODE_FMT_DEV:
> ip->i_d.di_forkoff = roundup(sizeof(xfs_dev_t), 8) >> 3;
> break;
> - case XFS_DINODE_FMT_UUID:
> - ip->i_d.di_forkoff = roundup(sizeof(uuid_t), 8) >> 3;
> - break;
> case XFS_DINODE_FMT_LOCAL:
> case XFS_DINODE_FMT_EXTENTS:
> case XFS_DINODE_FMT_BTREE:
> diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
> index 23229f0c5b15..66f9b9f61d92 100644
> --- a/fs/xfs/libxfs/xfs_format.h
> +++ b/fs/xfs/libxfs/xfs_format.h
> @@ -941,7 +941,7 @@ typedef enum xfs_dinode_fmt {
> XFS_DINODE_FMT_LOCAL, /* bulk data */
> XFS_DINODE_FMT_EXTENTS, /* struct xfs_bmbt_rec */
> XFS_DINODE_FMT_BTREE, /* struct xfs_bmdr_block */
> - XFS_DINODE_FMT_UUID /* uuid_t */
> + XFS_DINODE_FMT_UUID /* added long ago, but never used */
> } xfs_dinode_fmt_t;
>
> /*
> diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
> index 31786bad9738..1d003ca21562 100644
> --- a/fs/xfs/libxfs/xfs_inode_fork.c
> +++ b/fs/xfs/libxfs/xfs_inode_fork.c
> @@ -902,15 +902,6 @@ xfs_iflush_fork(
> }
> break;
>
> - case XFS_DINODE_FMT_UUID:
> - if (iip->ili_fields & XFS_ILOG_UUID) {
> - ASSERT(whichfork == XFS_DATA_FORK);
> - memcpy(XFS_DFORK_DPTR(dip),
> - &ip->i_df.if_u2.if_uuid,
> - sizeof(uuid_t));
> - }
> - break;
> -
> default:
> ASSERT(0);
> break;
> diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h
> index 6750f0462d21..064babdc373c 100644
> --- a/fs/xfs/libxfs/xfs_inode_fork.h
> +++ b/fs/xfs/libxfs/xfs_inode_fork.h
> @@ -70,7 +70,6 @@ typedef struct xfs_ifork {
> char if_inline_data[XFS_INLINE_DATA];
> /* very small file data */
> xfs_dev_t if_rdev; /* dev number if special */
> - uuid_t if_uuid; /* mount point value */
> } if_u2;
> } xfs_ifork_t;
>
> diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h
> index 71de185735e0..a7ab6adae7f6 100644
> --- a/fs/xfs/libxfs/xfs_log_format.h
> +++ b/fs/xfs/libxfs/xfs_log_format.h
> @@ -274,7 +274,7 @@ typedef struct xfs_inode_log_format {
> uint64_t ilf_ino; /* inode number */
> union {
> uint32_t ilfu_rdev; /* rdev value for dev inode*/
> - uuid_t ilfu_uuid; /* mount point value */
> + u8 __pad[16]; /* unused */
> } ilf_u;
> int64_t ilf_blkno; /* blkno of inode buffer */
> int32_t ilf_len; /* len of inode buffer */
> @@ -295,7 +295,7 @@ struct xfs_inode_log_format_32 {
> uint64_t ilf_ino; /* inode number */
> union {
> uint32_t ilfu_rdev; /* rdev value for dev inode*/
> - uuid_t ilfu_uuid; /* mount point value */
> + u8 __pad[16]; /* unused */
> } ilf_u;
> int64_t ilf_blkno; /* blkno of inode buffer */
> int32_t ilf_len; /* len of inode buffer */
> @@ -311,7 +311,7 @@ struct xfs_inode_log_format_32 {
> #define XFS_ILOG_DEXT 0x004 /* log i_df.if_extents */
> #define XFS_ILOG_DBROOT 0x008 /* log i_df.i_broot */
> #define XFS_ILOG_DEV 0x010 /* log the dev field */
> -#define XFS_ILOG_UUID 0x020 /* log the uuid field */
> +#define XFS_ILOG_UUID 0x020 /* added long ago, but never used */
> #define XFS_ILOG_ADATA 0x040 /* log i_af.if_data */
> #define XFS_ILOG_AEXT 0x080 /* log i_af.if_extents */
> #define XFS_ILOG_ABROOT 0x100 /* log i_af.i_broot */
> @@ -329,9 +329,9 @@ struct xfs_inode_log_format_32 {
>
> #define XFS_ILOG_NONCORE (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
> XFS_ILOG_DBROOT | XFS_ILOG_DEV | \
> - XFS_ILOG_UUID | XFS_ILOG_ADATA | \
> - XFS_ILOG_AEXT | XFS_ILOG_ABROOT | \
> - XFS_ILOG_DOWNER | XFS_ILOG_AOWNER)
> + XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
> + XFS_ILOG_ABROOT | XFS_ILOG_DOWNER | \
> + XFS_ILOG_AOWNER)
>
> #define XFS_ILOG_DFORK (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
> XFS_ILOG_DBROOT)
> @@ -341,10 +341,10 @@ struct xfs_inode_log_format_32 {
>
> #define XFS_ILOG_ALL (XFS_ILOG_CORE | XFS_ILOG_DDATA | \
> XFS_ILOG_DEXT | XFS_ILOG_DBROOT | \
> - XFS_ILOG_DEV | XFS_ILOG_UUID | \
> - XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
> - XFS_ILOG_ABROOT | XFS_ILOG_TIMESTAMP | \
> - XFS_ILOG_DOWNER | XFS_ILOG_AOWNER)
> + XFS_ILOG_DEV | XFS_ILOG_ADATA | \
> + XFS_ILOG_AEXT | XFS_ILOG_ABROOT | \
> + XFS_ILOG_TIMESTAMP | XFS_ILOG_DOWNER | \
> + XFS_ILOG_AOWNER)
>
> static inline int xfs_ilog_fbroot(int w)
> {
> diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
> index 9bbc2d7cc8cb..bd60ad313173 100644
> --- a/fs/xfs/xfs_inode_item.c
> +++ b/fs/xfs/xfs_inode_item.c
> @@ -72,7 +72,6 @@ xfs_inode_item_data_fork_size(
> break;
>
> case XFS_DINODE_FMT_DEV:
> - case XFS_DINODE_FMT_UUID:
> break;
> default:
> ASSERT(0);
> @@ -156,8 +155,7 @@ xfs_inode_item_format_data_fork(
> switch (ip->i_d.di_format) {
> case XFS_DINODE_FMT_EXTENTS:
> iip->ili_fields &=
> - ~(XFS_ILOG_DDATA | XFS_ILOG_DBROOT |
> - XFS_ILOG_DEV | XFS_ILOG_UUID);
> + ~(XFS_ILOG_DDATA | XFS_ILOG_DBROOT | XFS_ILOG_DEV);
>
> if ((iip->ili_fields & XFS_ILOG_DEXT) &&
> ip->i_d.di_nextents > 0 &&
> @@ -181,8 +179,7 @@ xfs_inode_item_format_data_fork(
> break;
> case XFS_DINODE_FMT_BTREE:
> iip->ili_fields &=
> - ~(XFS_ILOG_DDATA | XFS_ILOG_DEXT |
> - XFS_ILOG_DEV | XFS_ILOG_UUID);
> + ~(XFS_ILOG_DDATA | XFS_ILOG_DEXT | XFS_ILOG_DEV);
>
> if ((iip->ili_fields & XFS_ILOG_DBROOT) &&
> ip->i_df.if_broot_bytes > 0) {
> @@ -200,8 +197,7 @@ xfs_inode_item_format_data_fork(
> break;
> case XFS_DINODE_FMT_LOCAL:
> iip->ili_fields &=
> - ~(XFS_ILOG_DEXT | XFS_ILOG_DBROOT |
> - XFS_ILOG_DEV | XFS_ILOG_UUID);
> + ~(XFS_ILOG_DEXT | XFS_ILOG_DBROOT | XFS_ILOG_DEV);
> if ((iip->ili_fields & XFS_ILOG_DDATA) &&
> ip->i_df.if_bytes > 0) {
> /*
> @@ -224,18 +220,10 @@ xfs_inode_item_format_data_fork(
> break;
> case XFS_DINODE_FMT_DEV:
> iip->ili_fields &=
> - ~(XFS_ILOG_DDATA | XFS_ILOG_DBROOT |
> - XFS_ILOG_DEXT | XFS_ILOG_UUID);
> + ~(XFS_ILOG_DDATA | XFS_ILOG_DBROOT | XFS_ILOG_DEXT);
> if (iip->ili_fields & XFS_ILOG_DEV)
> ilf->ilf_u.ilfu_rdev = ip->i_df.if_u2.if_rdev;
> break;
> - case XFS_DINODE_FMT_UUID:
> - iip->ili_fields &=
> - ~(XFS_ILOG_DDATA | XFS_ILOG_DBROOT |
> - XFS_ILOG_DEXT | XFS_ILOG_DEV);
> - if (iip->ili_fields & XFS_ILOG_UUID)
> - ilf->ilf_u.ilfu_uuid = ip->i_df.if_u2.if_uuid;
> - break;
> default:
> ASSERT(0);
> break;
> @@ -441,7 +429,7 @@ xfs_inode_item_format(
> ilf->ilf_dsize = 0;
> ilf->ilf_asize = 0;
> ilf->ilf_pad = 0;
> - uuid_copy(&ilf->ilf_u.ilfu_uuid, &uuid_null);
> + memset(&ilf->ilf_u, 0, sizeof(ilf->ilf_u));
>
> xlog_finish_iovec(lv, vecp, sizeof(*ilf));
>
> @@ -892,8 +880,7 @@ xfs_inode_item_format_convert(
> in_f->ilf_asize = in_f32->ilf_asize;
> in_f->ilf_dsize = in_f32->ilf_dsize;
> in_f->ilf_ino = in_f32->ilf_ino;
> - /* copy biggest field of ilf_u */
> - uuid_copy(&in_f->ilf_u.ilfu_uuid, &in_f32->ilf_u.ilfu_uuid);
> + memcpy(&in_f->ilf_u, &in_f32->ilf_u, sizeof(in_f->ilf_u));
> in_f->ilf_blkno = in_f32->ilf_blkno;
> in_f->ilf_len = in_f32->ilf_len;
> in_f->ilf_boffset = in_f32->ilf_boffset;
> diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
> index c393a2f6d8c3..23ba69fcc516 100644
> --- a/fs/xfs/xfs_itable.c
> +++ b/fs/xfs/xfs_itable.c
> @@ -124,7 +124,6 @@ xfs_bulkstat_one_int(
> buf->bs_blocks = 0;
> break;
> case XFS_DINODE_FMT_LOCAL:
> - case XFS_DINODE_FMT_UUID:
> buf->bs_rdev = 0;
> buf->bs_blksize = mp->m_sb.sb_blocksize;
> buf->bs_blocks = 0;
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index ee34899396b2..4e48e0534345 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -3163,16 +3163,8 @@ xlog_recover_inode_pass2(
> }
>
> fields = in_f->ilf_fields;
> - switch (fields & (XFS_ILOG_DEV | XFS_ILOG_UUID)) {
> - case XFS_ILOG_DEV:
> + if (fields & XFS_ILOG_DEV)
> xfs_dinode_put_rdev(dip, in_f->ilf_u.ilfu_rdev);
> - break;
> - case XFS_ILOG_UUID:
> - memcpy(XFS_DFORK_DPTR(dip),
> - &in_f->ilf_u.ilfu_uuid,
> - sizeof(uuid_t));
> - break;
> - }
>
> if (in_f->ilf_size == 2)
> goto out_owner_change;
> --
> 2.14.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-10-19 22:48 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 6:59 more extent mapping cleanups Christoph Hellwig
2017-10-19 6:59 ` [PATCH 01/15] xfs: add a xfs_bmap_fork_to_state helper Christoph Hellwig
2017-10-19 22:48 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 02/15] xfs: make better use of the 'state' variable in xfs_bmap_del_extent_real Christoph Hellwig
2017-10-19 22:49 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 03/15] xfs: remove post-bmap tracing in xfs_bmap_local_to_extents Christoph Hellwig
2017-10-19 22:49 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 04/15] xfs: move pre/post-bmap tracing into xfs_iext_update_extent Christoph Hellwig
2017-10-19 22:50 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 05/15] xfs: remove XFS_BMAP_TRACE_EXLIST Christoph Hellwig
2017-10-19 22:50 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 06/15] xfs: remove the never fully implemented UUID fork format Christoph Hellwig
2017-10-19 22:48 ` Darrick J. Wong [this message]
2017-10-20 7:02 ` Christoph Hellwig
2017-10-20 16:52 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 07/15] xfs: remove if_rdev Christoph Hellwig
2017-10-19 22:52 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 08/15] xfs: inline xfs_shift_file_space into callers Christoph Hellwig
2017-10-21 0:07 ` Darrick J. Wong
2017-10-21 8:13 ` Christoph Hellwig
2017-10-21 18:06 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 09/15] xfs: remove XFS_BMAP_MAX_SHIFT_EXTENTS Christoph Hellwig
2017-10-21 0:10 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 10/15] xfs: split xfs_bmap_shift_extents Christoph Hellwig
2017-10-21 0:22 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 11/15] xfs: remove xfs_bmse_shift_one Christoph Hellwig
2017-10-21 0:25 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 12/15] xfs: update got in xfs_bmap_shift_update_extent Christoph Hellwig
2017-10-21 0:25 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 13/15] xfs: don't rely on extent indices in xfs_bmap_collapse_extents Christoph Hellwig
2017-10-21 0:26 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 14/15] xfs: don't rely on extent indices in xfs_bmap_insert_extents Christoph Hellwig
2017-10-21 0:27 ` Darrick J. Wong
2017-10-19 6:59 ` [PATCH 15/15] xfs: rewrite xfs_bmap_first_unused to make better use of xfs_iext_get_extent Christoph Hellwig
2017-10-21 0:27 ` Darrick J. Wong
2017-10-19 20:04 ` more extent mapping cleanups Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171019224813.GP4755@magnolia \
--to=darrick.wong@oracle.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox