From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0393C133980 for ; Thu, 21 Mar 2024 16:37:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711039046; cv=none; b=JUg0D2ehaf4dWgt0azCHlvZbi4SaY9Zntz+KOJq0FsAVj1bS//uaZFyVrrwZ9etS5WddZJmVUP6XYMmR3thxsrUsETrn/cmW0TOIXUysTusovLHOZmhdmww7+ZLpI1pLeoDBfiae4+4+iaB4nzD233bTkqFC6i8OLpE6WyOOBVw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711039046; c=relaxed/simple; bh=nBNRzF0Iut6QyhQOmkq9JBSnSgGXOLqouFUVdOAZ0nY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Xa69l0Aucr0WRFUHH0N6HVlSuFYzLctMME3CqmORu2tj6PasCWuyh3BSu4pirsi3jaCofJbLcRcULNSSzKoA68/J8reWC4fxrD8Ris0V8hqTyPLFsaqzxKYCGqu8Z6xJ/ngbHbzPw0HaTrEDJdER1TGXhka0OJxXyy0KTPbTO9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=muav8Gem; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="muav8Gem" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dcc4563611cso1782262276.3 for ; Thu, 21 Mar 2024 09:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711039041; x=1711643841; darn=lists.linux.dev; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=jDSqL7VR8RZR1D2YCsFy3ymp62hocq5f4M4VfhBDRaA=; b=muav8GemwLabesGSMhdh9SVszKHUI2P+3669SLpu6zN5LyxxEGmCMATdolNJKLHHJZ xBvB/1J+0SjD4cZ+hBuxfpcb84HD1RjNFyTOxIOKqVB7u13u7Ji3wYjw/rA9KrYwXF41 HCVTXnotf7sD4fpSs4VElyqzhKzO4WefscJFqoM+eM89PU8X7jHlCrlAxdhgxbeFP+kN +X59/19pVgJGdLfIBlVXpzrRzrlvFqyMhoaEbos670u9ipEvxmTK4bc8C3N27fBdDDiS nb6nW/4AHbWMvReIeo17gc49Kbe1lGJWtLYljMyCumkFvHj52c7J0wCuht37qAXx95Pg CYUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711039041; x=1711643841; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jDSqL7VR8RZR1D2YCsFy3ymp62hocq5f4M4VfhBDRaA=; b=XR6WYjsmhyTyjiyxNpyHwIh3zGwVu1VfpzIRgevKmqwYDjk6icW+9B9Ms1X6ERpw9u KAMTOYUkAUlOArNNNSQ4gN5Wm1/DuqwvoCfgbLVfHr6d8kBHpkoQnC03EYPrMRxr7hEJ ArNKpTJKJcu8b72KaocKxKylAsXW/+7MH27335xfaOBpuix5qynyuBF6tbIg/uqAKCmP 2bBTXmCvJU5qWaohzOjhKokru18A9KD4+akbJhLwUWhlaoPRiCwFGqxnMpMDkcHtpz0R IpurorRHbnrMJIKd3CzTlXDVgE6401jN3UBpL6BVuSN7eVh2jqcEPy3qnZJELkT7t9E5 RJRA== X-Forwarded-Encrypted: i=1; AJvYcCXUyYT3dxizxbJj5d2HBuPR0rgTj+4emVaWwnGfsu9Fdlm46ImtjhIGz48xrrKDSgwwUwiQQRgbKH/2N9GXlyIwlc6mYUE= X-Gm-Message-State: AOJu0YzQ7NSRZG6Hkb4LOZD4G27YjMIokLjpNrOgj8E9b7cjcCRunBp9 VtuTYtqqhFVsPb2+O/miva7CRmZysm3mQR4Sg9ywc4eV0FFa4SxuQHLzfLIsf/EVizdGNMVaLNr 01Q== X-Google-Smtp-Source: AGHT+IGraxwr8LJ1oKM13+l6GlQVbxX2plMlllQyHlZ1hTZW8w83otTqaTPIW9YmGt7R4YAvcGIgF556yuY= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:a489:6433:be5d:e639]) (user=surenb job=sendgmr) by 2002:a05:6902:703:b0:dc2:550b:a4f4 with SMTP id k3-20020a056902070300b00dc2550ba4f4mr5784120ybt.1.1711039040945; Thu, 21 Mar 2024 09:37:20 -0700 (PDT) Date: Thu, 21 Mar 2024 09:36:27 -0700 In-Reply-To: <20240321163705.3067592-1-surenb@google.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240321163705.3067592-1-surenb@google.com> X-Mailer: git-send-email 2.44.0.291.gc1ea87d7ee-goog Message-ID: <20240321163705.3067592-6-surenb@google.com> Subject: [PATCH v6 05/37] fs: Convert alloc_inode_sb() to a macro From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, penguin-kernel@i-love.sakura.ne.jp, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, jhubbard@nvidia.com, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, songmuchun@bytedance.com, jbaron@akamai.com, aliceryhl@google.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, surenb@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org, Alexander Viro Content-Type: text/plain; charset="UTF-8" From: Kent Overstreet We're introducing alloc tagging, which tracks memory allocations by callsite. Converting alloc_inode_sb() to a macro means allocations will be tracked by its caller, which is a bit more useful. Signed-off-by: Kent Overstreet Signed-off-by: Suren Baghdasaryan Cc: Alexander Viro Reviewed-by: Kees Cook Reviewed-by: Pasha Tatashin --- include/linux/fs.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 00fc429b0af0..034f0c918eea 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3083,11 +3083,7 @@ int setattr_should_drop_sgid(struct mnt_idmap *idmap, * This must be used for allocating filesystems specific inodes to set * up the inode reclaim context correctly. */ -static inline void * -alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, gfp_t gfp) -{ - return kmem_cache_alloc_lru(cache, &sb->s_inode_lru, gfp); -} +#define alloc_inode_sb(_sb, _cache, _gfp) kmem_cache_alloc_lru(_cache, &_sb->s_inode_lru, _gfp) extern void __insert_inode_hash(struct inode *, unsigned long hashval); static inline void insert_inode_hash(struct inode *inode) -- 2.44.0.291.gc1ea87d7ee-goog