From patchwork Thu Oct 31 05:59:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhiguo Niu X-Patchwork-Id: 13857576 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F3D7E68956 for ; Thu, 31 Oct 2024 06:00:52 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t6OEl-0003ok-0S; Thu, 31 Oct 2024 06:00:51 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t6OEj-0003oe-Gm for linux-f2fs-devel@lists.sourceforge.net; Thu, 31 Oct 2024 06:00:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject: CC:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0eg3qTPgc8OrDWQZm19EGDHrnrX0LbkMA1XCSw9bngA=; b=kqXrQrNRU63010d+Y2V2M+/PwF jWC99IxiZQn0U/F7EkZgJI6qrwCYVUmPD/LSDsfYnYl3z2p+ZtAsiz7vKULcZuKkmxyxFx2rzHQE8 x9DMNZmiTpe+NuEblUjiplOwNmjYOfcvt3C2W81uyK0SqDDMOJnG8LP1ubyH+ctsVOHw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=0eg3qTPgc8OrDWQZm19EGDHrnrX0LbkMA1XCSw9bngA=; b=X iRTF9ZjOOcJDimksU4C3pGfmdtVHIe4EkC79Yc5/qd2D8U8h/lcz8mauReJ1HW6hvWYSMLkiPlkvE CUYJhkkPaW/mwXI1Za3qUPnWzHYCD/Col8jV67yYOYscixVUdN1IO99OU3t9dKX+xTfBMxFo1C3k0 mSRqPXnwBNtwtjkQ=; Received: from mx1.unisoc.com ([222.66.158.135] helo=SHSQR01.spreadtrum.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t6OEg-000382-US for linux-f2fs-devel@lists.sourceforge.net; Thu, 31 Oct 2024 06:00:50 +0000 Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 49V60AU4088189; Thu, 31 Oct 2024 14:00:10 +0800 (+08) (envelope-from Zhiguo.Niu@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4XfCxb2ZN1z2K4gjP; Thu, 31 Oct 2024 13:59:31 +0800 (CST) Received: from bj08434pcu.spreadtrum.com (10.0.73.87) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 31 Oct 2024 14:00:08 +0800 From: Zhiguo Niu To: , Date: Thu, 31 Oct 2024 13:59:52 +0800 Message-ID: <1730354393-19672-1-git-send-email-zhiguo.niu@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.0.73.87] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 49V60AU4088189 X-Headers-End: 1t6OEg-000382-US Subject: [f2fs-dev] [PATCH 1/2] f2fs: remove redundant atomic file check in defragment X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ke.wang@unisoc.com, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, zhiguo.niu@unisoc.com, Hao_hao.Wang@unisoc.com Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net f2fs_is_atomic_file(inode) is checked in f2fs_defragment_range, so remove the redundant checking in f2fs_ioc_defragment. Signed-off-by: Zhiguo Niu Reviewed-by: Chao Yu --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 75a8b22..3e22f6e 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2883,7 +2883,7 @@ static int f2fs_ioc_defragment(struct file *filp, unsigned long arg) if (!capable(CAP_SYS_ADMIN)) return -EPERM; - if (!S_ISREG(inode->i_mode) || f2fs_is_atomic_file(inode)) + if (!S_ISREG(inode->i_mode)) return -EINVAL; if (f2fs_readonly(sbi->sb))