btrfs: use struct qstr instead of name and namelen pairs
authorSweet Tea Dorminy <sweettea-kernel@dorminy.me>
Thu, 20 Oct 2022 16:58:25 +0000 (12:58 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:43 +0000 (18:00 +0100)
commite43eec81c5167b655b72c781b0e75e62a05e415e
treeb8b4c1d64d18acb56b809f1b084296ee1531f48c
parent82c0efd3cd5d4ecce028da75d29e3345535b3389
btrfs: use struct qstr instead of name and namelen pairs

Many functions throughout btrfs take name buffer and name length
arguments. Most of these functions at the highest level are usually
called with these arguments extracted from a supplied dentry's name.
But the entire name can be passed instead, making each function a little
more elegant.

Each function whose arguments are currently the name and length
extracted from a dentry is herein converted to instead take a pointer to
the name in the dentry. The couple of calls to these calls without a
struct dentry are converted to create an appropriate qstr to pass in.
Additionally, every function which is only called with a name/len
extracted directly from a qstr is also converted.

This change has positive effect on stack consumption, frame of many
functions is reduced but this will be used in the future for fscrypt
related structures.

Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
12 files changed:
fs/btrfs/ctree.h
fs/btrfs/dir-item.c
fs/btrfs/inode-item.c
fs/btrfs/inode-item.h
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/root-tree.c
fs/btrfs/send.c
fs/btrfs/super.c
fs/btrfs/transaction.c
fs/btrfs/tree-log.c
fs/btrfs/tree-log.h