Skip to content

Commit a567411

Browse files
Kent Overstreetakpm00
authored andcommitted
fs: convert alloc_inode_sb() to a macro
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. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kent Overstreet <[email protected]> Signed-off-by: Suren Baghdasaryan <[email protected]> Cc: Alexander Viro <[email protected]> Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Pasha Tatashin <[email protected]> Tested-by: Kees Cook <[email protected]> Cc: Alex Gaynor <[email protected]> Cc: Alice Ryhl <[email protected]> Cc: Andreas Hindborg <[email protected]> Cc: Benno Lossin <[email protected]> Cc: "Björn Roy Baron" <[email protected]> Cc: Boqun Feng <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Dennis Zhou <[email protected]> Cc: Gary Guo <[email protected]> Cc: Miguel Ojeda <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Wedson Almeida Filho <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent a7f13d0 commit a567411

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

include/linux/fs.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3085,11 +3085,7 @@ int setattr_should_drop_sgid(struct mnt_idmap *idmap,
30853085
* This must be used for allocating filesystems specific inodes to set
30863086
* up the inode reclaim context correctly.
30873087
*/
3088-
static inline void *
3089-
alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, gfp_t gfp)
3090-
{
3091-
return kmem_cache_alloc_lru(cache, &sb->s_inode_lru, gfp);
3092-
}
3088+
#define alloc_inode_sb(_sb, _cache, _gfp) kmem_cache_alloc_lru(_cache, &_sb->s_inode_lru, _gfp)
30933089

30943090
extern void __insert_inode_hash(struct inode *, unsigned long hashval);
30953091
static inline void insert_inode_hash(struct inode *inode)

0 commit comments

Comments
 (0)