From patchwork Thu Mar 3 23:18:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 12768274 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D854C4332F for ; Thu, 3 Mar 2022 23:19:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236940AbiCCXUS (ORCPT ); Thu, 3 Mar 2022 18:20:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236642AbiCCXUO (ORCPT ); Thu, 3 Mar 2022 18:20:14 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BF5C15F090 for ; Thu, 3 Mar 2022 15:19:27 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id mr24-20020a17090b239800b001bf0a375440so3776171pjb.4 for ; Thu, 03 Mar 2022 15:19:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oz1oNqIfMm4Cmy4YhvA49X206rRkGkJIw0ay+dbHTpQ=; b=uwdTwMBuKVSy7bQk5Yjr935Awtku5OyCOrUXT6Hh1QZc7DSxmMBG0c6apgCVBaO5q2 T5CJRKdF7l+Sa3GrX8YIirisnNgbsVakN7QKt6O6i71FySwhjiT8OWnEmphctYk8i7oK 2DaS+CejrYpThxPuHcpZmFkkhk1mZD/ompmMe5M8CJOnhtD0SsjMRNdZJLx5leGW7lo2 Pl7VF1bm9givr0dilnkm5sbtMENdUhJ1nV71rs4+KED/rEaITggfYmEBIxnuFsAiHw99 slOfS7XKZW30v0UMog8zEkWTS2NZYZSBI+LvfxZBH+nvKEmXWtKZBut2feVPw/UyhxVT Rmhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oz1oNqIfMm4Cmy4YhvA49X206rRkGkJIw0ay+dbHTpQ=; b=NL7t/8m2iyxeS46vS0Y3nWoNkcJGlvY42SrjGJw8zUbO2NxSm9nT0ARsBlRFc2KyC4 hg+FI7BnyAnJFs/lHnElqMIhuXuqoq79OFLnrBfn//Z1aMdDlluMNgZ79gVQPqisVtYL DPqYUNuROy2m8I3gTG2NHN5UtDnycLTuFbgolGWxYqcTWEHwPVGVnbh4lkldms7ciVCg UoVcGKPY3NzdTHrL5fEmN9e58Q30lVEfgUo5KBxzKzGau0pPGiS/XSxznB3fOda2jGyz +DiLvLSXcHl2V/D5AeOaogYfRUqYPXl8C8WSCiai/pBQKLcfAaZovT9BTRpc81eixvF9 vEgg== X-Gm-Message-State: AOAM532j9iqZ8IKq2M1N2/UpkT04te7r3ybiswxYX2hBYuLqF53TgO/w yOoMLpwz8BzMvdcNYCN29iGZw+4XRK/h7A== X-Google-Smtp-Source: ABdhPJxqMMQsJhXoo8QpA7O1O7jCx6WbOsGWu8TUAVzFRJNxeSGueXGD+LJuFNPN+vjPbIC97Wrmrw== X-Received: by 2002:a17:902:aa84:b0:150:8d6:bdec with SMTP id d4-20020a170902aa8400b0015008d6bdecmr37956806plr.118.1646349566533; Thu, 03 Mar 2022 15:19:26 -0800 (PST) Received: from relinquished.tfbnw.net ([2620:10d:c090:400::5:76ce]) by smtp.gmail.com with ESMTPSA id x7-20020a17090a1f8700b001bf1db72189sm1103507pja.23.2022.03.03.15.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 15:19:26 -0800 (PST) From: Omar Sandoval To: linux-btrfs@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH 06/12] btrfs: remove unnecessary set_nlink() in btrfs_create_subvol_root() Date: Thu, 3 Mar 2022 15:18:56 -0800 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Omar Sandoval btrfs_new_inode() already returns an inode with nlink set to 1 (via inode_init_always()). Get rid of the unnecessary set. Signed-off-by: Omar Sandoval --- fs/btrfs/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b7d54b0b2fb5..a9dabe9e5500 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8784,7 +8784,6 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, inode->i_op = &btrfs_dir_inode_operations; inode->i_fop = &btrfs_dir_file_operations; - set_nlink(inode, 1); unlock_new_inode(inode); err = btrfs_subvol_inherit_props(trans, new_root, parent_root);