public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Myers <bpm@sgi.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 13/19] xfs: vectorise directory data operations
Date: Thu, 24 Oct 2013 13:39:09 -0500	[thread overview]
Message-ID: <20131024183909.GV1935@sgi.com> (raw)
In-Reply-To: <1381789085-21923-14-git-send-email-david@fromorbit.com>

On Tue, Oct 15, 2013 at 09:17:59AM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> Following from the initial patches to vectorise the shortform
> directory encode/decode operations, convert half the data block
> operations to use the vector. The rest will be done in a second
> patch.
> 
> This further reduces the size of the built binary:
> 
>    text    data     bss     dec     hex filename
>  794490   96802    1096  892388   d9de4 fs/xfs/xfs.o.orig
>  792986   96802    1096  890884   d9804 fs/xfs/xfs.o.p1
>  792350   96802    1096  890248   d9588 fs/xfs/xfs.o.p2
>  789293   96802    1096  887191   d8997 fs/xfs/xfs.o.p3
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Generally looks pretty good, I have a question below...

>  const struct xfs_dir_ops xfs_dir2_ftype_ops = {
> @@ -223,6 +415,18 @@ const struct xfs_dir_ops xfs_dir2_ftype_ops = {
>  	.sf_put_ino = xfs_dir3_sfe_put_ino,
>  	.sf_get_parent_ino = xfs_dir2_sf_get_parent_ino,
>  	.sf_put_parent_ino = xfs_dir2_sf_put_parent_ino,
> +
> +	.data_entsize = xfs_dir3_data_entsize,
> +	.data_get_ftype = xfs_dir3_data_get_ftype,
> +	.data_put_ftype = xfs_dir3_data_put_ftype,
> +	.data_entry_tag_p = xfs_dir3_data_entry_tag_p,
> +
> +	.data_dot_offset = xfs_dir2_data_dot_offset,
> +	.data_dotdot_offset = xfs_dir2_data_dotdot_offset,
> +	.data_first_offset = xfs_dir2_data_first_offset,
> +	.data_dot_entry_p = xfs_dir2_data_dot_entry_p,
> +	.data_dotdot_entry_p = xfs_dir2_data_dotdot_entry_p,
> +	.data_first_entry_p = xfs_dir2_data_first_entry_p,
>  };

I think there may be a problem here.  Although the dirv2 functions for
., .., and first entry offset account for the v2 header size, they
appear not to be accounting for the modified entry size due to the file
type field.  Am I missing something?

> @@ -1158,32 +1159,32 @@ xfs_dir2_sf_to_block(
>  	/*
>  	 * Create entry for .
>  	 */
> -	dep = xfs_dir3_data_dot_entry_p(mp, hdr);
> +	dep = dp->d_ops->data_dot_entry_p(hdr);
>  	dep->inumber = cpu_to_be64(dp->i_ino);
>  	dep->namelen = 1;
>  	dep->name[0] = '.';
> -	xfs_dir3_dirent_put_ftype(mp, dep, XFS_DIR3_FT_DIR);
> -	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
> +	dp->d_ops->data_put_ftype(dep, XFS_DIR3_FT_DIR);
> +	tagp = dp->d_ops->data_entry_tag_p(dep);
>  	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
> -	xfs_dir2_data_log_entry(tp, bp, dep);
> +	xfs_dir2_data_log_entry(tp, dp, bp, dep);
>  	blp[0].hashval = cpu_to_be32(xfs_dir_hash_dot);
>  	blp[0].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp,
>  				(char *)dep - (char *)hdr));
>  	/*
>  	 * Create entry for ..
>  	 */
> -	dep = xfs_dir3_data_dotdot_entry_p(mp, hdr);
> +	dep = dp->d_ops->data_dotdot_entry_p(hdr);
>  	dep->inumber = cpu_to_be64(dp->d_ops->sf_get_parent_ino(sfp));
>  	dep->namelen = 2;
>  	dep->name[0] = dep->name[1] = '.';
> -	xfs_dir3_dirent_put_ftype(mp, dep, XFS_DIR3_FT_DIR);
> -	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
> +	dp->d_ops->data_put_ftype(dep, XFS_DIR3_FT_DIR);
> +	tagp =dp->d_ops-> data_entry_tag_p(dep);

	tagp = dp->d_ops->data_entry_tag_p(dep);

> diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c
> index ccfeb4d..571e173 100644
> --- a/fs/xfs/xfs_dir2_data.c
> +++ b/fs/xfs/xfs_dir2_data.c
> @@ -62,12 +62,26 @@ __xfs_dir3_data_check(
>  	char			*p;		/* current data position */
>  	int			stale;		/* count of stale leaves */
>  	struct xfs_name		name;
> +	const struct xfs_dir_ops *ops;
>  
>  	mp = bp->b_target->bt_mount;
>  	hdr = bp->b_addr;
>  	bf = xfs_dir3_data_bestfree_p(hdr);
>  	p = (char *)xfs_dir3_data_entry_p(hdr);
>  
> +	/*
> +	 * we can be passed a null dp here froma verifier, so manually configure

					   from a 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2013-10-24 18:39 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-14 22:17 [PATCH 00/19 V2] xfs: patches for 3.13 Dave Chinner
2013-10-14 22:17 ` [PATCH 01/19] xfs: xfs_remove deadlocks due to inverted AGF vs AGI lock ordering Dave Chinner
2013-10-14 22:17 ` [PATCH 02/19] xfs: open code inc_inode_iversion when logging an inode Dave Chinner
2013-10-14 22:17 ` [PATCH 03/19] xfs: prevent deadlock trying to cover an active log Dave Chinner
2013-10-17 15:54   ` Eric Sandeen
2013-10-17 18:51     ` Ben Myers
2013-10-14 22:17 ` [PATCH 04/19] xfs: create a shared header file for format-related information Dave Chinner
2013-10-22 23:12   ` Ben Myers
2013-10-22 23:36     ` [PATCH 04/19, V2] " Dave Chinner
2013-10-14 22:17 ` [PATCH 05/19] xfs: unify directory/attribute format definitions Dave Chinner
2013-10-21 23:11   ` Ben Myers
2013-10-21 23:33     ` Dave Chinner
2013-10-22 14:57       ` Christoph Hellwig
2013-10-14 22:17 ` [PATCH 06/19] xfs: split dquot buffer operations out Dave Chinner
2013-10-14 22:17 ` [PATCH 07/19] xfs: remove unused transaction callback variables Dave Chinner
2013-10-22 14:25   ` Ben Myers
2013-10-14 22:17 ` [PATCH 08/19] xfs: decouple log and transaction headers Dave Chinner
2013-10-22 17:16   ` Ben Myers
2013-10-22 23:50     ` [PATCH 08/19, V2] " Dave Chinner
2013-10-14 22:17 ` [PATCH 09/19] xfs: decouple inode and bmap btree header files Dave Chinner
2013-10-22 18:29   ` Ben Myers
2013-10-22 23:40     ` [PATCH 09/19, V2] " Dave Chinner
2013-10-22 23:48       ` Dave Chinner
2013-10-22 23:51     ` [PATCH 09/19, V3] " Dave Chinner
2013-10-14 22:17 ` [PATCH 10/19] xfs: split xfs_rtalloc.c for userspace sanity Dave Chinner
2013-10-14 22:17 ` [PATCH 11/19] xfs: abstract the differences in dir2/dir3 via an ops vector Dave Chinner
2013-10-14 22:17 ` [PATCH 12/19] xfs: vectorise remaining shortform dir2 ops Dave Chinner
2013-10-14 22:17 ` [PATCH 13/19] xfs: vectorise directory data operations Dave Chinner
2013-10-24 18:39   ` Ben Myers [this message]
2013-10-24 21:31     ` Dave Chinner
2013-10-24 21:41       ` Ben Myers
2013-10-24 22:08         ` Dave Chinner
2013-10-24 22:28           ` Ben Myers
2013-10-27 23:01             ` Dave Chinner
2013-10-14 22:18 ` [PATCH 14/19] xfs: vectorise directory data operations part 2 Dave Chinner
2013-10-14 22:18 ` [PATCH 15/19] xfs: vectorise directory leaf operations Dave Chinner
2013-10-20 23:25   ` [PATCH 15/19, V2] " Dave Chinner
2013-10-14 22:18 ` [PATCH 16/19] xfs: vectorise DA btree operations Dave Chinner
2013-10-25 17:17   ` Ben Myers
2013-10-14 22:18 ` [PATCH 17/19] xfs: vectorise encoding/decoding directory headers Dave Chinner
2013-10-25 18:46   ` Ben Myers
2013-10-25 19:20     ` Ben Myers
2013-10-14 22:18 ` [PATCH 18/19] xfs: vectorise directory leaf operations Dave Chinner
2013-10-25 20:18   ` Ben Myers
2013-10-25 21:51   ` Ben Myers
2013-10-14 22:18 ` [PATCH 19/19] xfs: convert directory vector functions to constants Dave Chinner
2013-10-16 21:16   ` Ben Myers
2013-10-16 22:23     ` Dave Chinner
2013-10-16 22:52       ` Ben Myers
2013-10-16 23:06         ` Ben Myers
2013-10-17  0:17           ` Dave Chinner
2013-10-23 22:23             ` Ben Myers
2013-10-25 21:47   ` Ben Myers
2013-10-23 22:23 ` [PATCH 00/19 V2] xfs: patches for 3.13 Ben Myers

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=20131024183909.GV1935@sgi.com \
    --to=bpm@sgi.com \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /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