From patchwork Wed May 20 01:45:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559109 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C249F618 for ; Wed, 20 May 2020 01:45:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AAFD820835 for ; Wed, 20 May 2020 01:45:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ykWblUao" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728395AbgETBpb (ORCPT ); Tue, 19 May 2020 21:45:31 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:39426 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbgETBpa (ORCPT ); Tue, 19 May 2020 21:45:30 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1fkat163607; Wed, 20 May 2020 01:45:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=8xwu4wjB2AvX+egHVHBohhpwW30/QTSsd1ZWJ6pgJMc=; b=ykWblUaoUJKZBG3HkDJyQEt4nVXcOjypOBwns3wrsQvGT6selQVJSI7fJhgYWcsxfgqc 73LIk1ErESxInz2O07HwMeUoR/Mz14p7UVNVYSUrzjFpg9u7fODCtmIBuqGhG/uD/ZLO pTTuF9N3NYig6icv5gGkuyuy5aTVJ+Fv47bMpXjNjr7Lnq9TEp9ibJMIjQqov/NSistM dRCNOw+FXk+OK5SXXkG7EVlbnnEnUVqif/H7/DUChXQW88JWJofjnQo/6jBLgJMBoqMb Ad0uQtRRZoSm+YZkn6yZHGqI3evBNirUfJS2hjFo6ZwYi63r/8sOPsza8zSSuh5W0NXH mQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 31284m0h9u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:45:27 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1h9o5032629; Wed, 20 May 2020 01:45:26 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 312sxtudq3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:45:26 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04K1jPU7024109; Wed, 20 May 2020 01:45:25 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:45:25 -0700 Subject: [PATCH 01/11] xfs: move eofblocks conversion function to xfs_ioctl.c From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:45:24 -0700 Message-ID: <158993912447.976105.10249427349387670469.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 suspectscore=1 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 mlxscore=0 cotscore=-2147483648 impostorscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Move xfs_fs_eofblocks_from_user into the only file that actually uses it, so that we don't have this function cluttering up the header file. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_icache.h | 35 ----------------------------------- fs/xfs/xfs_ioctl.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h index 48f1fd2bb6ad..c13bc8a3e02f 100644 --- a/fs/xfs/xfs_icache.h +++ b/fs/xfs/xfs_icache.h @@ -81,41 +81,6 @@ int xfs_inode_ag_iterator_tag(struct xfs_mount *mp, int (*execute)(struct xfs_inode *ip, int flags, void *args), int flags, void *args, int tag); -static inline int -xfs_fs_eofblocks_from_user( - struct xfs_fs_eofblocks *src, - struct xfs_eofblocks *dst) -{ - if (src->eof_version != XFS_EOFBLOCKS_VERSION) - return -EINVAL; - - if (src->eof_flags & ~XFS_EOF_FLAGS_VALID) - return -EINVAL; - - if (memchr_inv(&src->pad32, 0, sizeof(src->pad32)) || - memchr_inv(src->pad64, 0, sizeof(src->pad64))) - return -EINVAL; - - dst->eof_flags = src->eof_flags; - dst->eof_prid = src->eof_prid; - dst->eof_min_file_size = src->eof_min_file_size; - - dst->eof_uid = INVALID_UID; - if (src->eof_flags & XFS_EOF_FLAGS_UID) { - dst->eof_uid = make_kuid(current_user_ns(), src->eof_uid); - if (!uid_valid(dst->eof_uid)) - return -EINVAL; - } - - dst->eof_gid = INVALID_GID; - if (src->eof_flags & XFS_EOF_FLAGS_GID) { - dst->eof_gid = make_kgid(current_user_ns(), src->eof_gid); - if (!gid_valid(dst->eof_gid)) - return -EINVAL; - } - return 0; -} - int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino, bool *inuse); diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 309958186d33..6a3c675a8aeb 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -2082,6 +2082,41 @@ xfs_ioc_setlabel( return error; } +static inline int +xfs_fs_eofblocks_from_user( + struct xfs_fs_eofblocks *src, + struct xfs_eofblocks *dst) +{ + if (src->eof_version != XFS_EOFBLOCKS_VERSION) + return -EINVAL; + + if (src->eof_flags & ~XFS_EOF_FLAGS_VALID) + return -EINVAL; + + if (memchr_inv(&src->pad32, 0, sizeof(src->pad32)) || + memchr_inv(src->pad64, 0, sizeof(src->pad64))) + return -EINVAL; + + dst->eof_flags = src->eof_flags; + dst->eof_prid = src->eof_prid; + dst->eof_min_file_size = src->eof_min_file_size; + + dst->eof_uid = INVALID_UID; + if (src->eof_flags & XFS_EOF_FLAGS_UID) { + dst->eof_uid = make_kuid(current_user_ns(), src->eof_uid); + if (!uid_valid(dst->eof_uid)) + return -EINVAL; + } + + dst->eof_gid = INVALID_GID; + if (src->eof_flags & XFS_EOF_FLAGS_GID) { + dst->eof_gid = make_kgid(current_user_ns(), src->eof_gid); + if (!gid_valid(dst->eof_gid)) + return -EINVAL; + } + return 0; +} + /* * Note: some of the ioctl's return positive numbers as a * byte count indicating success, such as readlink_by_handle. From patchwork Wed May 20 01:45:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559111 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6363618 for ; Wed, 20 May 2020 01:45:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD9FC20829 for ; Wed, 20 May 2020 01:45:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="GPZUi+1I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726432AbgETBpg (ORCPT ); Tue, 19 May 2020 21:45:36 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:39480 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbgETBpg (ORCPT ); Tue, 19 May 2020 21:45:36 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1gLlX163740; Wed, 20 May 2020 01:45:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=3Rx4HS3cQzAebsleD2+7FVTfQCxqmPrJsSAG8FVedrY=; b=GPZUi+1IxV7uXtzzH2BPMiUvFSoyFZJArd22zOtVsMN90aYpGwKwmcb1NtMZoOszUL8w M3WtJFBC/kpPVVZXn4hlUYOYUmZZ8GPYMrJR+2cvCUdyK8p1ytjGmj4ORUVjoXJ0eFGA TIBhWRJYJHgEZunzSlHShTHe13UcUT/FL82pg1JCZuR/Q/Qe7k2F+SStuA/cG/l1Ms7/ PPANqkJDoyu7Rp02pPmhf7cWW5GuTWUqpUrg8bLoQZBShKTsFPq1LI286jwQYeZpu/0j RUNxlXGqFkw73JqoFxZGKY4Gx7sS4T7H4HSEDMHYuKmP0NE+OB1f/oE6u4oPFKCuEaTA kw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 31284m0ha2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:45:33 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1iP5r078070; Wed, 20 May 2020 01:45:32 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 314gm64376-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:45:32 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 04K1jVks008281; Wed, 20 May 2020 01:45:31 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:45:31 -0700 Subject: [PATCH 02/11] xfs: replace open-coded XFS_ICI_NO_TAG From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:45:30 -0700 Message-ID: <158993913066.976105.11360328085268419085.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=877 adultscore=0 phishscore=0 mlxscore=0 spamscore=0 suspectscore=1 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 mlxscore=0 cotscore=-2147483648 impostorscore=0 malwarescore=0 mlxlogscore=903 lowpriorityscore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Use XFS_ICI_NO_TAG instead of -1 when appropriate. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_icache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 0ed904c2aa12..b1e2541810be 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -815,7 +815,7 @@ xfs_inode_ag_walk( rcu_read_lock(); - if (tag == -1) + if (tag == XFS_ICI_NO_TAG) nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, (void **)batch, first_index, XFS_LOOKUP_BATCH); @@ -973,8 +973,8 @@ xfs_inode_ag_iterator_flags( ag = 0; while ((pag = xfs_perag_get(mp, ag))) { ag = pag->pag_agno + 1; - error = xfs_inode_ag_walk(mp, pag, execute, flags, args, -1, - iter_flags); + error = xfs_inode_ag_walk(mp, pag, execute, flags, args, + XFS_ICI_NO_TAG, iter_flags); xfs_perag_put(pag); if (error) { last_error = error; From patchwork Wed May 20 01:45:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559125 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 83E9F13B1 for ; Wed, 20 May 2020 01:47:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D11C207D8 for ; Wed, 20 May 2020 01:47:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="K/ua39KY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726595AbgETBrn (ORCPT ); Tue, 19 May 2020 21:47:43 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:37498 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgETBrm (ORCPT ); Tue, 19 May 2020 21:47:42 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1lDg6027034; Wed, 20 May 2020 01:47:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=DjE1uIIFxQIQ8iwV/tXLez77VTzx8ScKw6GLf2vLddI=; b=K/ua39KYdV2nYxNV02YEZG2o1ZNfLEb97bEvNojouX4nX+NCxhh40z1LutWvfJORVVS0 08lFB3OfD1JDbaxUMBXm2haHQNlfXRHBG7aPfwwrl7CA4/9wD1omCgU20TvPzvfBvLEN ivb3JB5asptpXOXhTRu9nyD15exP3MCGT1B4pvgCt9zCHZ0HqlyBqb1ZHfWiDlQ1tVjK RQse2MIc4IBogOVY3BHazpmNB/zTCvh6eolLYnPoIgSqvLzF4BC4yQrK5XnvoUzALAzL hRfwb7nuPpz3QZU3IiUYOWrkUXEQ8ay5EtNDyqp6HovAo81lDIiOzJCVUM7p4Gml4MoW bw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 3127kr8jgf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:47:39 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1h8ft032515; Wed, 20 May 2020 01:45:38 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 312sxtudv9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:45:38 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04K1jcqJ024225; Wed, 20 May 2020 01:45:38 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:45:37 -0700 Subject: [PATCH 03/11] xfs: remove unused xfs_inode_ag_iterator function From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:45:37 -0700 Message-ID: <158993913684.976105.8615567083408853948.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 suspectscore=3 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 impostorscore=0 suspectscore=3 mlxlogscore=999 malwarescore=0 cotscore=-2147483648 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200012 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Not used by anyone, so get rid of it. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_icache.c | 11 ----------- fs/xfs/xfs_icache.h | 3 --- 2 files changed, 14 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index b1e2541810be..6aafb547f21a 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -985,17 +985,6 @@ xfs_inode_ag_iterator_flags( return last_error; } -int -xfs_inode_ag_iterator( - struct xfs_mount *mp, - int (*execute)(struct xfs_inode *ip, int flags, - void *args), - int flags, - void *args) -{ - return xfs_inode_ag_iterator_flags(mp, execute, flags, args, 0); -} - int xfs_inode_ag_iterator_tag( struct xfs_mount *mp, diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h index c13bc8a3e02f..0556fa32074f 100644 --- a/fs/xfs/xfs_icache.h +++ b/fs/xfs/xfs_icache.h @@ -71,9 +71,6 @@ int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip); void xfs_cowblocks_worker(struct work_struct *); void xfs_queue_cowblocks(struct xfs_mount *); -int xfs_inode_ag_iterator(struct xfs_mount *mp, - int (*execute)(struct xfs_inode *ip, int flags, void *args), - int flags, void *args); int xfs_inode_ag_iterator_flags(struct xfs_mount *mp, int (*execute)(struct xfs_inode *ip, int flags, void *args), int flags, void *args, int iter_flags); From patchwork Wed May 20 01:45:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559115 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88C91618 for ; Wed, 20 May 2020 01:45:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6EC5D207D8 for ; Wed, 20 May 2020 01:45:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="O/O+5fBo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728176AbgETBpu (ORCPT ); Tue, 19 May 2020 21:45:50 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:45888 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbgETBpt (ORCPT ); Tue, 19 May 2020 21:45:49 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1fS5o062118; Wed, 20 May 2020 01:45:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=Vm2fNwKgZyXTy6zl+OkDL8SJf8syOvBqf54VSqYhdjo=; b=O/O+5fBoMDwd4a09/DDWasMDjAbBqaoTTxSTGjOULPstUpDTG7mHud5zUrcM97Z/w0xE wGzrfTR8PaLf9d8rqUQ0K5gsHqwBXqHijwTPM7lghJNYwPMgT3vTjtS4xqaEc7eeiGKO HDzfA9tsE2JS4HectfvaGd//6FJMwZAy2/cLyj3qPyGwDUGk7gzFaH3lCTDM5ZW0WCsM A6u4qpMXkQp1NYSE2C4LSAo3Qsdjb3CbFnJjiZUz4aUtGaDv3zu0gwFAtxvAJAdXeYNv i+4eqbsxJ+9tEjrnMzFutqd3r2zydTam7pZoEnuk5x5jH6dbVtHdOdTJ9o3LX/1eM8QD 7g== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 3128tngf0x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:45:45 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1h2S0132124; Wed, 20 May 2020 01:45:45 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 312t35yerp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:45:44 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 04K1jiRK008317; Wed, 20 May 2020 01:45:44 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:45:44 -0700 Subject: [PATCH 04/11] xfs: remove xfs_inode_ag_iterator_flags From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:45:43 -0700 Message-ID: <158993914319.976105.18105362179838631438.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 malwarescore=0 suspectscore=3 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 bulkscore=0 spamscore=0 clxscore=1015 cotscore=-2147483648 suspectscore=3 lowpriorityscore=0 adultscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Combine xfs_inode_ag_iterator_flags and xfs_inode_ag_iterator_tag into a single wrapper function since there's only one caller of the _flags variant. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_icache.c | 43 +++++++++++++------------------------------ fs/xfs/xfs_icache.h | 5 +---- fs/xfs/xfs_qm_syscalls.c | 4 ++-- 3 files changed, 16 insertions(+), 36 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 6aafb547f21a..e716b19879c6 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -956,38 +956,22 @@ xfs_cowblocks_worker( xfs_queue_cowblocks(mp); } -int -xfs_inode_ag_iterator_flags( +/* Fetch the next (possibly tagged) per-AG structure. */ +static inline struct xfs_perag * +xfs_ici_walk_get_perag( struct xfs_mount *mp, - int (*execute)(struct xfs_inode *ip, int flags, - void *args), - int flags, - void *args, - int iter_flags) + xfs_agnumber_t agno, + int tag) { - struct xfs_perag *pag; - int error = 0; - int last_error = 0; - xfs_agnumber_t ag; - - ag = 0; - while ((pag = xfs_perag_get(mp, ag))) { - ag = pag->pag_agno + 1; - error = xfs_inode_ag_walk(mp, pag, execute, flags, args, - XFS_ICI_NO_TAG, iter_flags); - xfs_perag_put(pag); - if (error) { - last_error = error; - if (error == -EFSCORRUPTED) - break; - } - } - return last_error; + if (tag == XFS_ICI_NO_TAG) + return xfs_perag_get(mp, agno); + return xfs_perag_get_tag(mp, agno, tag); } int -xfs_inode_ag_iterator_tag( +xfs_inode_ag_iterator( struct xfs_mount *mp, + int iter_flags, int (*execute)(struct xfs_inode *ip, int flags, void *args), int flags, @@ -1000,10 +984,10 @@ xfs_inode_ag_iterator_tag( xfs_agnumber_t ag; ag = 0; - while ((pag = xfs_perag_get_tag(mp, ag, tag))) { + while ((pag = xfs_ici_walk_get_perag(mp, ag, tag))) { ag = pag->pag_agno + 1; error = xfs_inode_ag_walk(mp, pag, execute, flags, args, tag, - 0); + iter_flags); xfs_perag_put(pag); if (error) { last_error = error; @@ -1523,8 +1507,7 @@ __xfs_icache_free_eofblocks( if (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC)) flags = SYNC_WAIT; - return xfs_inode_ag_iterator_tag(mp, execute, flags, - eofb, tag); + return xfs_inode_ag_iterator(mp, 0, execute, flags, eofb, tag); } int diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h index 0556fa32074f..2d5ab9957d9f 100644 --- a/fs/xfs/xfs_icache.h +++ b/fs/xfs/xfs_icache.h @@ -71,10 +71,7 @@ int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip); void xfs_cowblocks_worker(struct work_struct *); void xfs_queue_cowblocks(struct xfs_mount *); -int xfs_inode_ag_iterator_flags(struct xfs_mount *mp, - int (*execute)(struct xfs_inode *ip, int flags, void *args), - int flags, void *args, int iter_flags); -int xfs_inode_ag_iterator_tag(struct xfs_mount *mp, +int xfs_inode_ag_iterator(struct xfs_mount *mp, int iter_flags, int (*execute)(struct xfs_inode *ip, int flags, void *args), int flags, void *args, int tag); diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index 5d5ac65aa1cc..a9460bdcca87 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c @@ -772,6 +772,6 @@ xfs_qm_dqrele_all_inodes( uint flags) { ASSERT(mp->m_quotainfo); - xfs_inode_ag_iterator_flags(mp, xfs_dqrele_inode, flags, NULL, - XFS_AGITER_INEW_WAIT); + xfs_inode_ag_iterator(mp, XFS_AGITER_INEW_WAIT, xfs_dqrele_inode, + flags, NULL, XFS_ICI_NO_TAG); } From patchwork Wed May 20 01:45:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559119 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B947138A for ; Wed, 20 May 2020 01:45:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F30320829 for ; Wed, 20 May 2020 01:45:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="l6ulyftN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728129AbgETBpz (ORCPT ); Tue, 19 May 2020 21:45:55 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:45920 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbgETBpz (ORCPT ); Tue, 19 May 2020 21:45:55 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1fOIM062052; Wed, 20 May 2020 01:45:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=fpbRGBllXqt5lhMsDJda5t3CZkijtUOeLmu5CFEEELM=; b=l6ulyftNUUR9gE6fiJpvk5c1UGWPstxvDkMtOoCFj62EouZLtmpA+saDl7Iiv8fEfw2d +CAIiMCUVA+5y+lqqVS4ZaoUZKhhgMDjbe7ShVeeODyO7JpVJGOrLOIyJTyaRYPevn3/ Ed0Ywlug3pXg/kDnr1aQkW2yyu4aqxOuLUk4QxM4br7lDmxvCTFcyd2bvFN6lrv2HGQT D3IgDHdi1iV26QUxebYPGdc9Jxj/6IiTji7e5lMp1J48tSwW9sbzB5I+ls9Ie9Kd9mSJ 7Eyy8HIbsBO7ByYlOZjOeXWen6lOrv+5I7hh+fnFiiEIOl1Z+t0iZHVrNDTQ+3cE3+hD 6Q== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 3128tngf14-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:45:51 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1iPVu078092; Wed, 20 May 2020 01:45:51 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 314gm643e0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:45:51 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04K1jouJ024243; Wed, 20 May 2020 01:45:51 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:45:50 -0700 Subject: [PATCH 05/11] xfs: remove flags argument from xfs_inode_ag_walk From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:45:49 -0700 Message-ID: <158993914950.976105.8586367797907212993.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 adultscore=0 phishscore=0 mlxscore=0 spamscore=0 suspectscore=3 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 bulkscore=0 spamscore=0 clxscore=1015 cotscore=-2147483648 suspectscore=3 lowpriorityscore=0 adultscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong The incore inode walk code passes a flags argument and a pointer from the xfs_inode_ag_iterator caller all the way to the iteration function. We can reduce the function complexity by passing flags through the private pointer. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_icache.c | 38 ++++++++++++++------------------------ fs/xfs/xfs_icache.h | 4 ++-- fs/xfs/xfs_qm_syscalls.c | 25 +++++++++++++++++-------- 3 files changed, 33 insertions(+), 34 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index e716b19879c6..87b98bfdf27d 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -790,9 +790,7 @@ STATIC int xfs_inode_ag_walk( struct xfs_mount *mp, struct xfs_perag *pag, - int (*execute)(struct xfs_inode *ip, int flags, - void *args), - int flags, + int (*execute)(struct xfs_inode *ip, void *args), void *args, int tag, int iter_flags) @@ -868,7 +866,7 @@ xfs_inode_ag_walk( if ((iter_flags & XFS_AGITER_INEW_WAIT) && xfs_iflags_test(batch[i], XFS_INEW)) xfs_inew_wait(batch[i]); - error = execute(batch[i], flags, args); + error = execute(batch[i], args); xfs_irele(batch[i]); if (error == -EAGAIN) { skipped++; @@ -972,9 +970,7 @@ int xfs_inode_ag_iterator( struct xfs_mount *mp, int iter_flags, - int (*execute)(struct xfs_inode *ip, int flags, - void *args), - int flags, + int (*execute)(struct xfs_inode *ip, void *args), void *args, int tag) { @@ -986,7 +982,7 @@ xfs_inode_ag_iterator( ag = 0; while ((pag = xfs_ici_walk_get_perag(mp, ag, tag))) { ag = pag->pag_agno + 1; - error = xfs_inode_ag_walk(mp, pag, execute, flags, args, tag, + error = xfs_inode_ag_walk(mp, pag, execute, args, tag, iter_flags); xfs_perag_put(pag); if (error) { @@ -1443,12 +1439,14 @@ xfs_inode_match_id_union( STATIC int xfs_inode_free_eofblocks( struct xfs_inode *ip, - int flags, void *args) { - int ret = 0; - struct xfs_eofblocks *eofb = args; - int match; + struct xfs_eofblocks *eofb = args; + bool wait; + int match; + int ret = 0; + + wait = (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC)); if (!xfs_can_free_eofblocks(ip, false)) { /* inode could be preallocated or append-only */ @@ -1461,8 +1459,7 @@ xfs_inode_free_eofblocks( * If the mapping is dirty the operation can block and wait for some * time. Unless we are waiting, skip it. */ - if (!(flags & SYNC_WAIT) && - mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY)) + if (!wait && mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY)) return 0; if (eofb) { @@ -1484,7 +1481,7 @@ xfs_inode_free_eofblocks( * scanner moving and revisit the inode in a subsequent pass. */ if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) { - if (flags & SYNC_WAIT) + if (wait) ret = -EAGAIN; return ret; } @@ -1498,16 +1495,10 @@ static int __xfs_icache_free_eofblocks( struct xfs_mount *mp, struct xfs_eofblocks *eofb, - int (*execute)(struct xfs_inode *ip, int flags, - void *args), + int (*execute)(struct xfs_inode *ip, void *args), int tag) { - int flags = SYNC_TRYLOCK; - - if (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC)) - flags = SYNC_WAIT; - - return xfs_inode_ag_iterator(mp, 0, execute, flags, eofb, tag); + return xfs_inode_ag_iterator(mp, 0, execute, eofb, tag); } int @@ -1732,7 +1723,6 @@ xfs_prep_free_cowblocks( STATIC int xfs_inode_free_cowblocks( struct xfs_inode *ip, - int flags, void *args) { struct xfs_eofblocks *eofb = args; diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h index 2d5ab9957d9f..e7f86ebd7b22 100644 --- a/fs/xfs/xfs_icache.h +++ b/fs/xfs/xfs_icache.h @@ -72,8 +72,8 @@ void xfs_cowblocks_worker(struct work_struct *); void xfs_queue_cowblocks(struct xfs_mount *); int xfs_inode_ag_iterator(struct xfs_mount *mp, int iter_flags, - int (*execute)(struct xfs_inode *ip, int flags, void *args), - int flags, void *args, int tag); + int (*execute)(struct xfs_inode *ip, void *args), + void *args, int tag); int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino, bool *inuse); diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index a9460bdcca87..571ecb17b3bf 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c @@ -726,12 +726,17 @@ xfs_qm_scall_getquota_next( return error; } +struct xfs_dqrele { + uint flags; +}; + STATIC int xfs_dqrele_inode( struct xfs_inode *ip, - int flags, void *args) { + struct xfs_dqrele *dqr = args; + /* skip quota inodes */ if (ip == ip->i_mount->m_quotainfo->qi_uquotaip || ip == ip->i_mount->m_quotainfo->qi_gquotaip || @@ -743,15 +748,15 @@ xfs_dqrele_inode( } xfs_ilock(ip, XFS_ILOCK_EXCL); - if ((flags & XFS_UQUOTA_ACCT) && ip->i_udquot) { + if ((dqr->flags & XFS_UQUOTA_ACCT) && ip->i_udquot) { xfs_qm_dqrele(ip->i_udquot); ip->i_udquot = NULL; } - if ((flags & XFS_GQUOTA_ACCT) && ip->i_gdquot) { + if ((dqr->flags & XFS_GQUOTA_ACCT) && ip->i_gdquot) { xfs_qm_dqrele(ip->i_gdquot); ip->i_gdquot = NULL; } - if ((flags & XFS_PQUOTA_ACCT) && ip->i_pdquot) { + if ((dqr->flags & XFS_PQUOTA_ACCT) && ip->i_pdquot) { xfs_qm_dqrele(ip->i_pdquot); ip->i_pdquot = NULL; } @@ -768,10 +773,14 @@ xfs_dqrele_inode( */ void xfs_qm_dqrele_all_inodes( - struct xfs_mount *mp, - uint flags) + struct xfs_mount *mp, + uint flags) { + struct xfs_dqrele dqr = { + .flags = flags, + }; + ASSERT(mp->m_quotainfo); - xfs_inode_ag_iterator(mp, XFS_AGITER_INEW_WAIT, xfs_dqrele_inode, - flags, NULL, XFS_ICI_NO_TAG); + xfs_inode_ag_iterator(mp, XFS_AGITER_INEW_WAIT, xfs_dqrele_inode, &dqr, + XFS_ICI_NO_TAG); } From patchwork Wed May 20 01:45:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559121 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6F3F5138A for ; Wed, 20 May 2020 01:46:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56CAD207D8 for ; Wed, 20 May 2020 01:46:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="VDP2kcPS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728300AbgETBqC (ORCPT ); Tue, 19 May 2020 21:46:02 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:45982 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbgETBqB (ORCPT ); Tue, 19 May 2020 21:46:01 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1fhTb062209; Wed, 20 May 2020 01:45:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=Ns7yGFEvhoX9vmwB78jTZayTdSo94TUBuybLDEtWOSk=; b=VDP2kcPSbdFqsB03LLb4xe2Tr70vvl7Uh+wcE1ijYxaxfnZWRM4bkOmXidnytT7igVJO atgK90bCMJjtMRpV6uM7u+ucSflra8IiPC26uWzLFZ51SyRBWcCOJV0IijxO4ae6LWRW KHjfl15HJXV9VcLWm2sP0kINzzMFCw8oSfYxwISvqn1shEKYR0Vm1juY2OT0X5BOohLg 00C9vGBbNFXEt/hbYBjtWUfbzoWfbZSr20B+yoal1E7Q6qhUwK32rVzw7srE9pALTfTV Vx3Mncs800OX4ATmThFBHMrUjxUNzKvOX6/lnMif/2UCwqhIjpUMFByjCZ5mYDoLV6YT 0w== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 3128tngf1d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:45:58 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1iP5t078070; Wed, 20 May 2020 01:45:58 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 314gm643gq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:45:58 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 04K1jvlo008463; Wed, 20 May 2020 01:45:57 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:45:56 -0700 Subject: [PATCH 06/11] xfs: remove __xfs_icache_free_eofblocks From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:45:55 -0700 Message-ID: <158993915584.976105.10618142991104642219.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=943 adultscore=0 phishscore=0 mlxscore=0 spamscore=0 suspectscore=3 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 bulkscore=0 spamscore=0 clxscore=1015 cotscore=-2147483648 suspectscore=3 lowpriorityscore=0 adultscore=0 phishscore=0 mlxlogscore=981 mlxscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong This is now a pointless wrapper, so kill it. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_icache.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 87b98bfdf27d..ac66e7d8698d 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -1491,22 +1491,12 @@ xfs_inode_free_eofblocks( return ret; } -static int -__xfs_icache_free_eofblocks( - struct xfs_mount *mp, - struct xfs_eofblocks *eofb, - int (*execute)(struct xfs_inode *ip, void *args), - int tag) -{ - return xfs_inode_ag_iterator(mp, 0, execute, eofb, tag); -} - int xfs_icache_free_eofblocks( struct xfs_mount *mp, struct xfs_eofblocks *eofb) { - return __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_eofblocks, + return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_eofblocks, eofb, XFS_ICI_EOFBLOCKS_TAG); } @@ -1768,7 +1758,7 @@ xfs_icache_free_cowblocks( struct xfs_mount *mp, struct xfs_eofblocks *eofb) { - return __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_cowblocks, + return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_cowblocks, eofb, XFS_ICI_COWBLOCKS_TAG); } From patchwork Wed May 20 01:46:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559123 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9D0F618 for ; Wed, 20 May 2020 01:46:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D257B20829 for ; Wed, 20 May 2020 01:46:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="U1lj0Pa4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728345AbgETBqG (ORCPT ); Tue, 19 May 2020 21:46:06 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:39756 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbgETBqG (ORCPT ); Tue, 19 May 2020 21:46:06 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1gebl164539; Wed, 20 May 2020 01:46:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=zogVLiD9rH0YiIIzAndoIdj66uzYDzKPJLd7R4cVrw0=; b=U1lj0Pa4lG0EERK7ft8X9bSjR6XmFxHyBsFcoR48aLI2vmR+5BCoup7maWqVTJ1M6HDQ 98I29lzxqZGoRgqgdhyw6IzmYrBMUHKwfI/0XsWqeAmO5AGBOavyV64PLsdBOnlMAsyi 2Ayb5tszHwzX0/1LnU2Mul0+8QQGM2szQchrkfAHqVGEUFK7tAoQVuHuJmjtWeqs7YKT RPQ7dTPKTMfCoM2x9+HMkEs6mGk+oZFvN3mLMqSGahuKEoZm95ZTs73eDzKM0CKYnEJj vN8HQqrRHaGzK1bOD/ZPZwHkKtSFQBKF6UNXnebZtB+WRn3mPDSvNKXz1vewVeMn0ZJO Nw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 31284m0hbb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:46:04 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1gc9H143169; Wed, 20 May 2020 01:46:03 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 313gj2kb4r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:46:03 +0000 Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04K1k3V6004002; Wed, 20 May 2020 01:46:03 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:46:03 -0700 Subject: [PATCH 07/11] xfs: refactor eofb matching into a single helper From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:46:02 -0700 Message-ID: <158993916213.976105.11958914131452778480.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 suspectscore=3 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 mlxscore=0 cotscore=-2147483648 impostorscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Refactor the two eofb-matching logics into a single helper so that we don't repeat ourselves. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_icache.c | 59 +++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index ac66e7d8698d..1f12c6a0c48e 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -1436,6 +1436,33 @@ xfs_inode_match_id_union( return 0; } +/* + * Is this inode @ip eligible for eof/cow block reclamation, given some + * filtering parameters @eofb? The inode is eligible if @eofb is null or + * if the predicate functions match. + */ +static bool +xfs_inode_matches_eofb( + struct xfs_inode *ip, + struct xfs_eofblocks *eofb) +{ + int match; + + if (!eofb) + return true; + + if (eofb->eof_flags & XFS_EOF_FLAGS_UNION) + match = xfs_inode_match_id_union(ip, eofb); + else + match = xfs_inode_match_id(ip, eofb); + if (match) + return true; + + /* skip the inode if the file size is too small */ + return !(eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE && + XFS_ISIZE(ip) < eofb->eof_min_file_size); +} + STATIC int xfs_inode_free_eofblocks( struct xfs_inode *ip, @@ -1443,7 +1470,6 @@ xfs_inode_free_eofblocks( { struct xfs_eofblocks *eofb = args; bool wait; - int match; int ret = 0; wait = (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC)); @@ -1462,19 +1488,8 @@ xfs_inode_free_eofblocks( if (!wait && mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY)) return 0; - if (eofb) { - if (eofb->eof_flags & XFS_EOF_FLAGS_UNION) - match = xfs_inode_match_id_union(ip, eofb); - else - match = xfs_inode_match_id(ip, eofb); - if (!match) - return 0; - - /* skip the inode if the file size is too small */ - if (eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE && - XFS_ISIZE(ip) < eofb->eof_min_file_size) - return 0; - } + if (!xfs_inode_matches_eofb(ip, eofb)) + return 0; /* * If the caller is waiting, return -EAGAIN to keep the background @@ -1716,25 +1731,13 @@ xfs_inode_free_cowblocks( void *args) { struct xfs_eofblocks *eofb = args; - int match; int ret = 0; if (!xfs_prep_free_cowblocks(ip)) return 0; - if (eofb) { - if (eofb->eof_flags & XFS_EOF_FLAGS_UNION) - match = xfs_inode_match_id_union(ip, eofb); - else - match = xfs_inode_match_id(ip, eofb); - if (!match) - return 0; - - /* skip the inode if the file size is too small */ - if (eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE && - XFS_ISIZE(ip) < eofb->eof_min_file_size) - return 0; - } + if (!xfs_inode_matches_eofb(ip, eofb)) + return 0; /* Free the CoW blocks */ xfs_ilock(ip, XFS_IOLOCK_EXCL); From patchwork Wed May 20 01:46:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559129 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94007138A for ; Wed, 20 May 2020 01:48:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BC6F207D8 for ; Wed, 20 May 2020 01:48:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="fuP/AKuD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726379AbgETBsP (ORCPT ); Tue, 19 May 2020 21:48:15 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:40868 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgETBsO (ORCPT ); Tue, 19 May 2020 21:48:14 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1fkcq163605; Wed, 20 May 2020 01:46:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=4CYtu7BUJwdl2XX55givFa+cA6zS0lwk0iyINAMzb5w=; b=fuP/AKuDKm0B6kLljeekj7YMh9Q/uVC9q1+hfZWoDR4p1BS19GsCocghbHq0g187fUX6 OYgjhvyRVkL/IJ3xarffbAGgQ4ttkqHjco5EMWS4vEXxs+8lBln2Uxg3nfEE3QJXuqmq k8IDuYzdnycofq2rjKXoEy3ZBxbl+zN7k98JuJctMftFr5BkMsnC4c/cxd7UDIQ9ahwW 7ZGpBhzy79AryIg5KBmMPw1EeS1w9eHtjFHpDTJ1fx9AaEGapueAtc8V8b7+nGRuGMhE XmjQoFMIzh8hF7hrfSumRNTmUqVkCDMG3LihQZKVqjh6ybygdaXhSUQ4gtkK2wzxs+T7 Dw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 31284m0hbq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:46:11 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1h8MV032620; Wed, 20 May 2020 01:46:10 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 312sxtue6s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:46:10 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 04K1k9DK008479; Wed, 20 May 2020 01:46:09 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:46:09 -0700 Subject: [PATCH 08/11] xfs: fix inode ag walk predicate function return values From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:46:08 -0700 Message-ID: <158993916840.976105.5237746648594071986.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 suspectscore=1 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 mlxscore=0 cotscore=-2147483648 impostorscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong There are a number of predicate functions that help the incore inode walking code decide if we really want to apply the iteration function to the inode. These are boolean decisions, so change the return types to boolean to match. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_icache.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 1f12c6a0c48e..926927a5f42e 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -741,7 +741,12 @@ xfs_icache_inode_is_allocated( */ #define XFS_LOOKUP_BATCH 32 -STATIC int +/* + * Decide if the given @ip is eligible to be a part of the inode walk, and + * grab it if so. Returns true if it's ready to go or false if we should just + * ignore it. + */ +STATIC bool xfs_inode_ag_walk_grab( struct xfs_inode *ip, int flags) @@ -772,18 +777,18 @@ xfs_inode_ag_walk_grab( /* nothing to sync during shutdown */ if (XFS_FORCED_SHUTDOWN(ip->i_mount)) - return -EFSCORRUPTED; + return false; /* If we can't grab the inode, it must on it's way to reclaim. */ if (!igrab(inode)) - return -ENOENT; + return false; /* inode is valid */ - return 0; + return true; out_unlock_noent: spin_unlock(&ip->i_flags_lock); - return -ENOENT; + return false; } STATIC int @@ -835,7 +840,7 @@ xfs_inode_ag_walk( for (i = 0; i < nr_found; i++) { struct xfs_inode *ip = batch[i]; - if (done || xfs_inode_ag_walk_grab(ip, iter_flags)) + if (done || !xfs_inode_ag_walk_grab(ip, iter_flags)) batch[i] = NULL; /* @@ -1392,48 +1397,48 @@ xfs_reclaim_inodes_count( return reclaimable; } -STATIC int +STATIC bool xfs_inode_match_id( struct xfs_inode *ip, struct xfs_eofblocks *eofb) { if ((eofb->eof_flags & XFS_EOF_FLAGS_UID) && !uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid)) - return 0; + return false; if ((eofb->eof_flags & XFS_EOF_FLAGS_GID) && !gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid)) - return 0; + return false; if ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) && ip->i_d.di_projid != eofb->eof_prid) - return 0; + return false; - return 1; + return true; } /* * A union-based inode filtering algorithm. Process the inode if any of the * criteria match. This is for global/internal scans only. */ -STATIC int +STATIC bool xfs_inode_match_id_union( struct xfs_inode *ip, struct xfs_eofblocks *eofb) { if ((eofb->eof_flags & XFS_EOF_FLAGS_UID) && uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid)) - return 1; + return true; if ((eofb->eof_flags & XFS_EOF_FLAGS_GID) && gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid)) - return 1; + return true; if ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) && ip->i_d.di_projid == eofb->eof_prid) - return 1; + return true; - return 0; + return false; } /* @@ -1446,7 +1451,7 @@ xfs_inode_matches_eofb( struct xfs_inode *ip, struct xfs_eofblocks *eofb) { - int match; + bool match; if (!eofb) return true; From patchwork Wed May 20 01:46:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559131 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53492618 for ; Wed, 20 May 2020 01:48:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AA2D2075F for ; Wed, 20 May 2020 01:48:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="N04Yr9J7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728297AbgETBsa (ORCPT ); Tue, 19 May 2020 21:48:30 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:47168 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgETBsa (ORCPT ); Tue, 19 May 2020 21:48:30 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1fQH4062093; Wed, 20 May 2020 01:46:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=8IaD/KAWgQkxis2VQtg+gZczyWPfVsH6dB6XeguYc20=; b=N04Yr9J7Y91AxVYj3eE7flGqPdg/CBSRz+VSSETXOCmsiFE0V7/zxPc+m9dFqCVGHJeu GleQJ+rz6cCl86Us2aunm8EnGNzJEQzZPZUN3lWi7ciuG0Pi3/YZVwM47bu5ERWmgwM+ rAkUOL6PmDzPX+m1NO5mu2IL739dCvcJVYN8JJ5vMyoHUqxfyP8wo+A3clvtAZUxkUDu JGK8QRk5AtoIXQtWTdly6cyK3GPkxPhJ2YdKx327WhegVsf9RxajSWOc+W+QXoIYxsyb 5zBA9N/+eNMvwsM0smpf1ou45d0ht6ucAuzvhKH4veZi5YZXtF+lKdjc4PvRiFiseoJ7 ig== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 3128tngf1u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:46:16 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1gZ2Z142962; Wed, 20 May 2020 01:46:16 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 313gj2kb9b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:46:16 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 04K1kFSF008485; Wed, 20 May 2020 01:46:15 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:46:15 -0700 Subject: [PATCH 09/11] xfs: use bool for done in xfs_inode_ag_walk From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:46:14 -0700 Message-ID: <158993917464.976105.8225510964854349068.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 suspectscore=1 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 bulkscore=0 spamscore=0 clxscore=1015 cotscore=-2147483648 suspectscore=1 lowpriorityscore=0 adultscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong This is a boolean variable, so use the bool type. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_icache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 926927a5f42e..6c8c626e7ef1 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -803,11 +803,11 @@ xfs_inode_ag_walk( uint32_t first_index; int last_error = 0; int skipped; - int done; + bool done; int nr_found; restart: - done = 0; + done = false; skipped = 0; first_index = 0; nr_found = 0; @@ -859,7 +859,7 @@ xfs_inode_ag_walk( continue; first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino)) - done = 1; + done = true; } /* unlock now we've grabbed the inodes. */ From patchwork Wed May 20 01:46:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559135 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22A21138A for ; Wed, 20 May 2020 01:48:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B189207D8 for ; Wed, 20 May 2020 01:48:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="BvZelhaV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728176AbgETBsh (ORCPT ); Tue, 19 May 2020 21:48:37 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:47200 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgETBsh (ORCPT ); Tue, 19 May 2020 21:48:37 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1ldtI066176; Wed, 20 May 2020 01:48:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=7UhTh9jl7CRy/kNqvNn+6ISvvnHoCTekbakDbDaqNPU=; b=BvZelhaVJkWw7UwILllns0aUAL6tPEmiS4NAUWUH7C6g5yYwy3V8RYH84L5yohNAUFiV 1mJV+UiBy0PpTqTlP9Od1zt9ipsiAeAvf86dFIEpUjOhq420vziGrStAR9eZIIORZZCn m3cOYN26bg1kE7JwbhJ5xBV4mr/2Q97M8ZbKCGKErXpzUX2ZzHlb8/BUNLs1cg8Vhgxy /PmuFt6asElkUxeF2JczTzV81MvrEetxQ+TXlVAeI00uOSOdLStmkuJ7TmCDSlYVm/j6 5SRCy7szMYxQkufvtsYv++SIqJXUpoArTn4qvxqXHZF23YqFequjEMH3Z3qIUTPicQmU pw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 3128tngf6f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:48:23 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1gZEG143026; Wed, 20 May 2020 01:46:22 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 313gj2kbbk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:46:22 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 04K1kLKQ008497; Wed, 20 May 2020 01:46:21 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:46:21 -0700 Subject: [PATCH 10/11] xfs: move xfs_inode_ag_iterator to be closer to the perag walking code From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:46:20 -0700 Message-ID: <158993918077.976105.14120724292952648260.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 suspectscore=1 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 bulkscore=0 spamscore=0 clxscore=1015 cotscore=-2147483648 suspectscore=1 lowpriorityscore=0 adultscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200012 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Move the xfs_inode_ag_iterator function to be nearer xfs_inode_ag_walk so that we don't have to scroll back and forth to figure out how the incore inode walking function works. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_icache.c | 88 ++++++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 6c8c626e7ef1..05614758fb1e 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -791,6 +791,10 @@ xfs_inode_ag_walk_grab( return false; } +/* + * For a given per-AG structure @pag, @grab, @execute, and @rele all incore + * inodes with the given radix tree @tag. + */ STATIC int xfs_inode_ag_walk( struct xfs_mount *mp, @@ -896,6 +900,50 @@ xfs_inode_ag_walk( return last_error; } +/* Fetch the next (possibly tagged) per-AG structure. */ +static inline struct xfs_perag * +xfs_ici_walk_get_perag( + struct xfs_mount *mp, + xfs_agnumber_t agno, + int tag) +{ + if (tag == XFS_ICI_NO_TAG) + return xfs_perag_get(mp, agno); + return xfs_perag_get_tag(mp, agno, tag); +} + +/* + * Call the @execute function on all incore inodes matching the radix tree + * @tag. + */ +int +xfs_inode_ag_iterator( + struct xfs_mount *mp, + int iter_flags, + int (*execute)(struct xfs_inode *ip, void *args), + void *args, + int tag) +{ + struct xfs_perag *pag; + int error = 0; + int last_error = 0; + xfs_agnumber_t ag; + + ag = 0; + while ((pag = xfs_ici_walk_get_perag(mp, ag, tag))) { + ag = pag->pag_agno + 1; + error = xfs_inode_ag_walk(mp, pag, execute, args, tag, + iter_flags); + xfs_perag_put(pag); + if (error) { + last_error = error; + if (error == -EFSCORRUPTED) + break; + } + } + return last_error; +} + /* * Background scanning to trim post-EOF preallocated space. This is queued * based on the 'speculative_prealloc_lifetime' tunable (5m by default). @@ -959,46 +1007,6 @@ xfs_cowblocks_worker( xfs_queue_cowblocks(mp); } -/* Fetch the next (possibly tagged) per-AG structure. */ -static inline struct xfs_perag * -xfs_ici_walk_get_perag( - struct xfs_mount *mp, - xfs_agnumber_t agno, - int tag) -{ - if (tag == XFS_ICI_NO_TAG) - return xfs_perag_get(mp, agno); - return xfs_perag_get_tag(mp, agno, tag); -} - -int -xfs_inode_ag_iterator( - struct xfs_mount *mp, - int iter_flags, - int (*execute)(struct xfs_inode *ip, void *args), - void *args, - int tag) -{ - struct xfs_perag *pag; - int error = 0; - int last_error = 0; - xfs_agnumber_t ag; - - ag = 0; - while ((pag = xfs_ici_walk_get_perag(mp, ag, tag))) { - ag = pag->pag_agno + 1; - error = xfs_inode_ag_walk(mp, pag, execute, args, tag, - iter_flags); - xfs_perag_put(pag); - if (error) { - last_error = error; - if (error == -EFSCORRUPTED) - break; - } - } - return last_error; -} - /* * Grab the inode for reclaim exclusively. * Return 0 if we grabbed it, non-zero otherwise. From patchwork Wed May 20 01:46:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11559137 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A95A5138A for ; Wed, 20 May 2020 01:48:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 90B772075F for ; Wed, 20 May 2020 01:48:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="nt0TRMB3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728305AbgETBsm (ORCPT ); Tue, 19 May 2020 21:48:42 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:41128 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgETBsm (ORCPT ); Tue, 19 May 2020 21:48:42 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1gFP0163706; Wed, 20 May 2020 01:46:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=SNyndvqO6CnDp0iVq2j/ZLCqWmZYJhuQJoGQpLT+3OI=; b=nt0TRMB3cKE86pAhvewxEnSRvX/HdKDLAbdJdYS4zT0jxoaEv3pU1q6O4jAppuaLNTKP rP5ZHbtSblQJo/oPVzJDrMlKvFeo34E+/AQLNJaUjHlkziO2+RXDvRhsd7mkEYZpH9Ku Np3E1ZhM0PeNsbyRg6r8/fk57M3iiYzgpwkN3zvYTFQmpXKc9QIeQbo2lmSZmO3fe5a0 iLqAsrhe6BkAS4HBANeFYjpgpFtDUtgR99nuseCsiQ21XOoaNiwE7FgytmfxIzYFTyee HdZ89VBy+5bXl9PW9xOnTo736LIZm3qMyCUI+mMw3QwcP9R8eJfNU006DbUYsPcxP09A nQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 31284m0hc6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2020 01:46:28 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04K1gab4143098; Wed, 20 May 2020 01:46:28 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 313gj2kbdk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 May 2020 01:46:28 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04K1kStb004130; Wed, 20 May 2020 01:46:28 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 May 2020 18:46:27 -0700 Subject: [PATCH 11/11] xfs: hide most of the incore inode walk interface From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, hch@lst.de Date: Tue, 19 May 2020 18:46:27 -0700 Message-ID: <158993918698.976105.6231244252663510379.stgit@magnolia> In-Reply-To: <158993911808.976105.13679179790848338795.stgit@magnolia> References: <158993911808.976105.13679179790848338795.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 suspectscore=3 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9626 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 mlxscore=0 cotscore=-2147483648 impostorscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200011 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Hide the incore inode walk interface because callers outside of the icache code don't need to know about iter_flags and radix tags and other implementation details of the incore inode cache. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_icache.c | 30 ++++++++++++++++++++++-------- fs/xfs/xfs_icache.h | 8 ++++---- fs/xfs/xfs_qm_syscalls.c | 3 +-- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 05614758fb1e..73ac0e18498e 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -752,7 +752,7 @@ xfs_inode_ag_walk_grab( int flags) { struct inode *inode = VFS_I(ip); - bool newinos = !!(flags & XFS_AGITER_INEW_WAIT); + bool newinos = !!(flags & XFS_ICI_WALK_INEW_WAIT); ASSERT(rcu_read_lock_held()); @@ -796,7 +796,7 @@ xfs_inode_ag_walk_grab( * inodes with the given radix tree @tag. */ STATIC int -xfs_inode_ag_walk( +xfs_ici_walk_ag( struct xfs_mount *mp, struct xfs_perag *pag, int (*execute)(struct xfs_inode *ip, void *args), @@ -872,7 +872,7 @@ xfs_inode_ag_walk( for (i = 0; i < nr_found; i++) { if (!batch[i]) continue; - if ((iter_flags & XFS_AGITER_INEW_WAIT) && + if ((iter_flags & XFS_ICI_WALK_INEW_WAIT) && xfs_iflags_test(batch[i], XFS_INEW)) xfs_inew_wait(batch[i]); error = execute(batch[i], args); @@ -916,8 +916,8 @@ xfs_ici_walk_get_perag( * Call the @execute function on all incore inodes matching the radix tree * @tag. */ -int -xfs_inode_ag_iterator( +STATIC int +xfs_ici_walk( struct xfs_mount *mp, int iter_flags, int (*execute)(struct xfs_inode *ip, void *args), @@ -932,7 +932,7 @@ xfs_inode_ag_iterator( ag = 0; while ((pag = xfs_ici_walk_get_perag(mp, ag, tag))) { ag = pag->pag_agno + 1; - error = xfs_inode_ag_walk(mp, pag, execute, args, tag, + error = xfs_ici_walk_ag(mp, pag, execute, args, tag, iter_flags); xfs_perag_put(pag); if (error) { @@ -944,6 +944,20 @@ xfs_inode_ag_iterator( return last_error; } +/* + * Walk all incore inodes in the filesystem. Knowledge of radix tree tags + * is hidden and we always wait for INEW inodes. + */ +int +xfs_ici_walk_all( + struct xfs_mount *mp, + int (*execute)(struct xfs_inode *ip, void *args), + void *args) +{ + return xfs_ici_walk(mp, XFS_ICI_WALK_INEW_WAIT, execute, args, + XFS_ICI_NO_TAG); +} + /* * Background scanning to trim post-EOF preallocated space. This is queued * based on the 'speculative_prealloc_lifetime' tunable (5m by default). @@ -1524,7 +1538,7 @@ xfs_icache_free_eofblocks( struct xfs_mount *mp, struct xfs_eofblocks *eofb) { - return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_eofblocks, eofb, + return xfs_ici_walk(mp, 0, xfs_inode_free_eofblocks, eofb, XFS_ICI_EOFBLOCKS_TAG); } @@ -1774,7 +1788,7 @@ xfs_icache_free_cowblocks( struct xfs_mount *mp, struct xfs_eofblocks *eofb) { - return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_cowblocks, eofb, + return xfs_ici_walk(mp, 0, xfs_inode_free_cowblocks, eofb, XFS_ICI_COWBLOCKS_TAG); } diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h index e7f86ebd7b22..0dc85a03dc6c 100644 --- a/fs/xfs/xfs_icache.h +++ b/fs/xfs/xfs_icache.h @@ -38,9 +38,9 @@ struct xfs_eofblocks { #define XFS_IGET_INCORE 0x8 /* don't read from disk or reinit */ /* - * flags for AG inode iterator + * flags for incore inode iterator */ -#define XFS_AGITER_INEW_WAIT 0x1 /* wait on new inodes */ +#define XFS_ICI_WALK_INEW_WAIT 0x1 /* wait on new inodes */ int xfs_iget(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino, uint flags, uint lock_flags, xfs_inode_t **ipp); @@ -71,9 +71,9 @@ int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip); void xfs_cowblocks_worker(struct work_struct *); void xfs_queue_cowblocks(struct xfs_mount *); -int xfs_inode_ag_iterator(struct xfs_mount *mp, int iter_flags, +int xfs_ici_walk_all(struct xfs_mount *mp, int (*execute)(struct xfs_inode *ip, void *args), - void *args, int tag); + void *args); int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino, bool *inuse); diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index 571ecb17b3bf..95c44d5c57a8 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c @@ -781,6 +781,5 @@ xfs_qm_dqrele_all_inodes( }; ASSERT(mp->m_quotainfo); - xfs_inode_ag_iterator(mp, XFS_AGITER_INEW_WAIT, xfs_dqrele_inode, &dqr, - XFS_ICI_NO_TAG); + xfs_ici_walk_all(mp, xfs_dqrele_inode, &dqr); }