Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp385875rwe; Tue, 18 Apr 2023 23:51:05 -0700 (PDT) X-Google-Smtp-Source: AKy350ZmYBNvqNSdN4EowVsneeQ1HqmP9liCTzHszQH4KOK9lVJttpc/l9sFZpIM3hO4YFeU8TxG X-Received: by 2002:a9d:7c8d:0:b0:6a4:4f8e:830c with SMTP id q13-20020a9d7c8d000000b006a44f8e830cmr2665263otn.1.1681887064770; Tue, 18 Apr 2023 23:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681887064; cv=none; d=google.com; s=arc-20160816; b=l8MVrncLR4h0vwaPHO8ym+0qQW1bFdFgJUsWe4o3mPkb70mc1wxgjCyFaNQReIQXf+ fEw4XhyP5Rcqu9OCqtiJrmfST/wVlgeo8iqbkqM7MYgNGkPMPW4Ab+uUDziqjTZuys9U S6vaj1qCYFhIrzNEUTR9JqaAqix4o35vdtncVe2oKTJTpoAuyKBkTpbpf6YvHN3p9k1/ O6d1J6D/fewaj3DVxll4ai0P88DsVf3xj114waCSNxl8H5zyRCUAhAR5nZx4ai5sgo5k 9Ca8Aqj0BFLfojGOpfhq/6zOv8/fsPrg9KwOelOOoUKubJJKypcsiE6FSUikteNWdgWm unbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jqQrXVgyVsPhDEPu1uf0moF6UXupAeK1HLmcmrWKNZc=; b=aCpGUVwddtYXaACi4LlODpsVZwJm5Yfgwm1n+WeLzQDNuHyk6l+cI64AOCpsItYGSN GvEjJPnTq1YRCsAr2xSGSUYB2UBZKeCqzCZlCYdWU4fgpxdRtijdvUKGVlSaNZewOi+q 4K/Nw3eGMFyRWT2RNvqanRl9jPVx662rzDGFrXcQYz2lCbVRJnEtbtSr9obj7WTE82mE BeDk7W55OqdMpIsy+kVxOSAI3yjwS6ZoLICQoeBofJnI5fH0RK3P/igleRekjBClVlVN qBLwzm3Uz7ApHLwqDfH8hut5GrFo1H3dITrXBsMceIROE4WvNhncD4Z4uS/aWrQEFm+R /9qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pyZBCFKV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a9d6a09000000b006a1375fdfdasi14280549otn.279.2023.04.18.23.50.52; Tue, 18 Apr 2023 23:51:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pyZBCFKV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232327AbjDSGqh (ORCPT + 99 others); Wed, 19 Apr 2023 02:46:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232284AbjDSGqb (ORCPT ); Wed, 19 Apr 2023 02:46:31 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C2A85FC4 for ; Tue, 18 Apr 2023 23:46:29 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4ec8da7aaf8so2741763e87.2 for ; Tue, 18 Apr 2023 23:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681886787; x=1684478787; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jqQrXVgyVsPhDEPu1uf0moF6UXupAeK1HLmcmrWKNZc=; b=pyZBCFKVXGkGtbNForbz4oqn9aALt1yJ2qTv21sFpWCaPs7y3o3itPZwNlXYxDZ1X4 e2+zXbK8haPOL7atJAqJz3TSRswo+gxu2t3IOjoqXN+nKgGAPQEKIs6gmNj9ZwPHo+pW i00fxryFOga+RLGQZG0wffM8kE2IdiRgzBj2SgYHsU/t7UDAxJdONcYzSuzuvQgFR0Dr 0UeoU6NeLGqs2xvDOoXgvOMajG6MbEDkhvOqeqtFDBeWcjvp0OkTTpa53BOuYx++tWV5 la1d+FNAmh6NW2vBz2cTao+YfxDcFTDneLEhSmsAF0fv97V+CUwOm+62Tx0CD3e0vWa7 IehQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681886787; x=1684478787; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jqQrXVgyVsPhDEPu1uf0moF6UXupAeK1HLmcmrWKNZc=; b=Weqcbu0xJhV8KEJ2lwrj754FLrhB2IRs4YdF2ydBW/K7KqrCcqp8a8OvJ79oW0zV1v nJUVmodu+DDoCi+kymbPpMX8Jsqbhjw03dZJe/2COyEtj1Q3X4VxueWE2ZKm1j5tWfYt CwiUZCN4ezh22ZYP+A3fM6Nz1HnlCOKzV+6/VPsSWKCzfVWL3nBBedNSZZyrxMb/91+T N03sPm5RAOh/jqWjQ+HZxa+yO90/oz7NLf/Y8F76UmyDhOmEdQjkRqgp0ZRQZoX1JwYd BxL5Mb46CSfsaeYskeB4mRcPxb38xS6NRAfTa0B+QWpkqedSncai15ZOc3s1DcfpAz6Z uS+w== X-Gm-Message-State: AAQBX9e0e3wGpvn0m1+W/crW2Z9uAHY7XbiEP6pSgjqJy0rh6ZE8BkYA b9LrehuBWXlcDBH1bqea5yUagMdg+gw4zI4tLII5ow== X-Received: by 2002:ac2:551c:0:b0:4e7:dd1e:e521 with SMTP id j28-20020ac2551c000000b004e7dd1ee521mr3977750lfk.9.1681886787736; Tue, 18 Apr 2023 23:46:27 -0700 (PDT) Received: from ta1.c.googlers.com.com (61.215.228.35.bc.googleusercontent.com. [35.228.215.61]) by smtp.gmail.com with ESMTPSA id e24-20020ac25478000000b004edce1d338csm438208lfn.89.2023.04.18.23.46.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 23:46:26 -0700 (PDT) From: Tudor Ambarus To: stable@vger.kernel.org Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, joneslee@google.com, Ritesh Harjani , Tudor Ambarus Subject: [PATCH][for stable [4.14, 5.10] 2/3] ext4: remove duplicate definition of ext4_xattr_ibody_inline_set() Date: Wed, 19 Apr 2023 06:46:09 +0000 Message-ID: <20230419064610.1918038-3-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog In-Reply-To: <20230419064610.1918038-1-tudor.ambarus@linaro.org> References: <20230419064610.1918038-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ritesh Harjani [ Upstream commit 310c097c2bdbea253d6ee4e064f3e65580ef93ac ] ext4_xattr_ibody_inline_set() & ext4_xattr_ibody_set() have the exact same definition. Hence remove ext4_xattr_ibody_inline_set() and all its call references. Convert the callers of it to call ext4_xattr_ibody_set() instead. [ Modified to preserve ext4_xattr_ibody_set() and remove ext4_xattr_ibody_inline_set() instead. -- TYT ] Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/fd566b799bbbbe9b668eb5eecde5b5e319e3694f.1622685482.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o Signed-off-by: Tudor Ambarus --- fs/ext4/inline.c | 11 +++++------ fs/ext4/xattr.c | 26 +------------------------- fs/ext4/xattr.h | 6 +++--- 3 files changed, 9 insertions(+), 34 deletions(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 61cb50e8fcb7..0758f606f006 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -206,7 +206,7 @@ static int ext4_read_inline_data(struct inode *inode, void *buffer, /* * write the buffer to the inline inode. * If 'create' is set, we don't need to do the extra copy in the xattr - * value since it is already handled by ext4_xattr_ibody_inline_set. + * value since it is already handled by ext4_xattr_ibody_set. * That saves us one memcpy. */ static void ext4_write_inline_data(struct inode *inode, struct ext4_iloc *iloc, @@ -288,7 +288,7 @@ static int ext4_create_inline_data(handle_t *handle, BUG_ON(!is.s.not_found); - error = ext4_xattr_ibody_inline_set(handle, inode, &i, &is); + error = ext4_xattr_ibody_set(handle, inode, &i, &is); if (error) { if (error == -ENOSPC) ext4_clear_inode_state(inode, @@ -360,7 +360,7 @@ static int ext4_update_inline_data(handle_t *handle, struct inode *inode, i.value = value; i.value_len = len; - error = ext4_xattr_ibody_inline_set(handle, inode, &i, &is); + error = ext4_xattr_ibody_set(handle, inode, &i, &is); if (error) goto out; @@ -433,7 +433,7 @@ static int ext4_destroy_inline_data_nolock(handle_t *handle, if (error) goto out; - error = ext4_xattr_ibody_inline_set(handle, inode, &i, &is); + error = ext4_xattr_ibody_set(handle, inode, &i, &is); if (error) goto out; @@ -1930,8 +1930,7 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline) i.value = value; i.value_len = i_size > EXT4_MIN_INLINE_DATA_SIZE ? i_size - EXT4_MIN_INLINE_DATA_SIZE : 0; - err = ext4_xattr_ibody_inline_set(handle, inode, - &i, &is); + err = ext4_xattr_ibody_set(handle, inode, &i, &is); if (err) goto out_error; } diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 948da799abab..71e83e815258 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -2214,31 +2214,7 @@ int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i, return 0; } -int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode, - struct ext4_xattr_info *i, - struct ext4_xattr_ibody_find *is) -{ - struct ext4_xattr_ibody_header *header; - struct ext4_xattr_search *s = &is->s; - int error; - - if (EXT4_I(inode)->i_extra_isize == 0) - return -ENOSPC; - error = ext4_xattr_set_entry(i, s, handle, inode, false /* is_block */); - if (error) - return error; - header = IHDR(inode, ext4_raw_inode(&is->iloc)); - if (!IS_LAST_ENTRY(s->first)) { - header->h_magic = cpu_to_le32(EXT4_XATTR_MAGIC); - ext4_set_inode_state(inode, EXT4_STATE_XATTR); - } else { - header->h_magic = cpu_to_le32(0); - ext4_clear_inode_state(inode, EXT4_STATE_XATTR); - } - return 0; -} - -static int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, +int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, struct ext4_xattr_info *i, struct ext4_xattr_ibody_find *is) { diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h index b357872ab83b..e5e36bd11f05 100644 --- a/fs/ext4/xattr.h +++ b/fs/ext4/xattr.h @@ -200,9 +200,9 @@ extern int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i, extern int ext4_xattr_ibody_get(struct inode *inode, int name_index, const char *name, void *buffer, size_t buffer_size); -extern int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode, - struct ext4_xattr_info *i, - struct ext4_xattr_ibody_find *is); +extern int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, + struct ext4_xattr_info *i, + struct ext4_xattr_ibody_find *is); extern struct mb_cache *ext4_xattr_create_cache(void); extern void ext4_xattr_destroy_cache(struct mb_cache *); -- 2.40.0.634.g4ca3ef3211-goog