Thread (96 messages) 96 messages, 9 authors, 2024-03-12

Re: [PATCH v4 05/36] fs: Convert alloc_inode_sb() to a macro

From: Kent Overstreet <kent.overstreet@linux.dev>
Date: 2024-02-26 20:50:37
Also in: cgroups, linux-arch, linux-doc, linux-fsdevel, linux-iommu, linux-mm, lkml

On Mon, Feb 26, 2024 at 04:44:51PM +0100, Vlastimil Babka wrote:
On 2/21/24 20:40, Suren Baghdasaryan wrote:
quoted
From: Kent Overstreet <kent.overstreet@linux.dev>

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 <kent.overstreet@linux.dev>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Reviewed-by: Kees Cook <redacted>
---
 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 023f37c60709..08d8246399c3 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3010,11 +3010,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)
A __always_inline wouldn't have the same effect? Just wondering.
nope, macro expansion within an inline happens once, and will show
__func__ and __line__ of the helper, we want it expanded in the caller
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help