From patchwork Wed Mar 20 19:36:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10862533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D80531390 for ; Wed, 20 Mar 2019 19:37:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B74A228E55 for ; Wed, 20 Mar 2019 19:37:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABC3329C21; Wed, 20 Mar 2019 19:37:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59D1A2980D for ; Wed, 20 Mar 2019 19:37:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726239AbfCTThB (ORCPT ); Wed, 20 Mar 2019 15:37:01 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:59568 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbfCTThA (ORCPT ); Wed, 20 Mar 2019 15:37:00 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2KJXjAt121017; Wed, 20 Mar 2019 19:36:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=jJ4AvlBEMW64If6sOLoGfhMHWPE/b5DZBp7l6Oo73SY=; b=sgDaKZjEincZEjh1BSK+QYzVxMRKq/fnlmtSrkeI2INLO/j6EbU8jkVZnK7nVnfjXx4C PMEFHE450/kbjESXKt4OoM7Et5UD3mU4WNlrDPDbw3q6Hb1GZMLjOuWeoigqIUwNI7l/ QHKm/fok1JX0E2KrImOAYD7terMLuJOOhxguczneCK1WpBHzr4GCGypY6UPzPqkemAkD 4c33wde3GTwLpeBYRYZC4Qiux2iPDJJXH2WIEDfFVysdvt4wdGecJ0REjcFSiBvQ3nqM UyEJ08s3qCKCsVNldMp8wHWweKd4NvkfLVy6fZIgEXhsayyee46FpjWTUhcf4fvu0/WT hA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2r8ssrmqw0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 19:36:58 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2KJawJd031770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 19:36:58 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2KJaw6P001589; Wed, 20 Mar 2019 19:36:58 GMT Received: from localhost (/10.159.247.212) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 20 Mar 2019 12:36:57 -0700 Date: Wed, 20 Mar 2019 12:36:58 -0700 From: "Darrick J. Wong" To: sandeen@sandeen.net Cc: linux-xfs@vger.kernel.org Subject: [PATCH 42/36] xfs_db: refactor metadump handling of multi-fsb objects Message-ID: <20190320193658.GF1183@magnolia> References: <155259742281.31886.17157720770696604377.stgit@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <155259742281.31886.17157720770696604377.stgit@magnolia> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9201 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200142 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Separate the multi-fsb object dispatch from actual dir block processing so that we can implement symlink handling correctly as a multi-fsb file. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen --- db/metadump.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/db/metadump.c b/db/metadump.c index 3cce3012..83a257d0 100644 --- a/db/metadump.c +++ b/db/metadump.c @@ -1911,7 +1911,7 @@ static struct bbmap mfsb_map; static int mfsb_length; static int -process_multi_fsb_objects( +process_multi_fsb_dir( xfs_fileoff_t o, xfs_fsblock_t s, xfs_filblks_t c, @@ -1921,14 +1921,6 @@ process_multi_fsb_objects( char *dp; int ret = 0; - switch (btype) { - case TYP_DIR2: - break; - default: - print_warning("bad type for multi-fsb object %d", btype); - return -EINVAL; - } - while (c > 0) { unsigned int bm_len; @@ -1987,6 +1979,23 @@ process_multi_fsb_objects( return ret; } +static int +process_multi_fsb_objects( + xfs_fileoff_t o, + xfs_fsblock_t s, + xfs_filblks_t c, + typnm_t btype, + xfs_fileoff_t last) +{ + switch (btype) { + case TYP_DIR2: + return process_multi_fsb_dir(o, s, c, btype, last); + default: + print_warning("bad type for multi-fsb object %d", btype); + return -EINVAL; + } +} + /* inode copy routines */ static int process_bmbt_reclist(