xfs
[Top] [All Lists]

Re: [PATCH 13/16] xfs: vectorise encoding/decoding directory headers

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 13/16] xfs: vectorise encoding/decoding directory headers
From: "Michael L. Semon" <mlsemon35@xxxxxxxxx>
Date: Wed, 02 Oct 2013 10:07:52 -0400
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=HozBAGzAZ7gMNQLzxVyhsaaZ9EXcfVAPyGkgcz6LbIk=; b=C3MJ/KW7s0txNmuiF3YSFG9ICwHaGXysfr8vIeDXSVBMSZ07k7h3Wkznd15dZx9CNn 8sEL9lG4gH6hOPKGvtIZ1MoNHLs9zg6hCKPHB09odCcTwCJXN/M4LnnVB3eYjn0vrYLC DIY0maEfn7/PoFIANFeMzUCKEaqWCPxoXVLoVUVf/ezodMNWP1QovwYYFiHFhWfqMMd6 v0FYcnBWc+pq1elH1wt/xlLEVVF50+ljPGlSi0DXjj+NzZXv53Dujhv/Tpdn7kSPsBSQ 7f4U6whSkDEsJYjlVj/2ZQDYkbmTUf08vUoyihtVAlO5C4GWOdCC7VVMLeaJ+XZgYaQo rnvw==
In-reply-to: <1380510433-8353-14-git-send-email-david@xxxxxxxxxxxxx>
References: <1380510433-8353-1-git-send-email-david@xxxxxxxxxxxxx> <1380510433-8353-14-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
On 09/29/2013 11:07 PM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> Conversion from on-disk structures to in-core header structures
> currently relies on magic number checks. If the magic number is
> wrong, but one of the supported values, we do the wrong thing with
> the encode/decode operation. Split these functions so that there are
> discrete operations for the specific directory format we are
> handling.

[snip]

> diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
> index 17e65c7..aea65ce 100644
> --- a/fs/xfs/xfs_dir2_node.c
> +++ b/fs/xfs/xfs_dir2_node.c
> @@ -507,20 +460,20 @@ xfs_dir2_leafn_add(
>  #ifdef DEBUG
>  static void
>  xfs_dir2_free_hdr_check(
> -     struct xfs_mount *mp,
> +     struct xfs_inode *dp,
>       struct xfs_buf  *bp,
>       xfs_dir2_db_t   db)
>  {
>       struct xfs_dir3_icfree_hdr hdr;
>  
> -     xfs_dir3_free_hdr_from_disk(&hdr, bp->b_addr);
> +     dp->d_ops->free_hdr_from_disk(&hdr, bp->b_addr);
>  
> -     ASSERT((hdr.firstdb % xfs_dir3_free_max_bests(mp)) == 0);
> +     ASSERT((hdr.firstdb % xfs_dir3_free_max_bests(dp->i_mount)) == 0);
>       ASSERT(hdr.firstdb <= db);
>       ASSERT(db < hdr.firstdb + hdr.nvalid);
>  }
>  #else
> -#define xfs_dir2_free_hdr_check(mp, dp, db)
> +#define xfs_dir2_free_hdr_check(dp, dp, db)
>  #endif       /* DEBUG */

For non-debug XFS only, the above statement causes this to happen:

  CC      fs/xfs/xfs_dir2_data.o
  CC      fs/xfs/xfs_dir2_leaf.o
  CC      fs/xfs/xfs_dir2_node.o
fs/xfs/xfs_dir2_node.c:478:37: error: duplicate macro parameter "dp"
 #define xfs_dir2_free_hdr_check(dp, dp, db)
                                     ^
fs/xfs/xfs_dir2_node.c: In function 'xfs_dir2_leafn_lookup_for_addname':
fs/xfs/xfs_dir2_node.c:613:5: error: implicit declaration of function 
'xfs_dir2_free_hdr_check' [-Werror=implicit-function-declaration]
     xfs_dir2_free_hdr_check(dp, curbp, curdb);

I get by with a patch like this...

diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index 50958c3..30cbf10 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -475,7 +475,7 @@ xfs_dir2_free_hdr_check(
        ASSERT(db < hdr.firstdb + hdr.nvalid);
 }
 #else
-#define xfs_dir2_free_hdr_check(dp, dp, db)
+#define xfs_dir2_free_hdr_check(dp, bp, db)
 #endif /* DEBUG */
 
 /*
-- 
1.8.3.2

...but really don't know what trouble this will cause.  xfstests looks 
OK on one PC, not so good on the other PC: underpowered hardware, bad 
science, upgraded kernel and xfsprogs at the same time, etc., ...

Thanks!

Michael

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH 13/16] xfs: vectorise encoding/decoding directory headers, Michael L. Semon <=