Change allocation from kmalloc() to stack
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest7 patches 12 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | btrfs: Allocate walk_control on stackfs/ | +36 | 3 replies | |
| 2/7 | btrfs: Allocate file_ra_state on stackfs/ | +3 | 1 reply | |
| 3/7 | btrfs: Allocate btrfs_ioctl_get_subvol_info_args on stackfs/ | +24 | 3 replies | |
| 4/7 | btrfs: Allocate btrfs_ioctl_balance_args on stackfs/ | +3 | 2 replies | |
| 5/7 | btrfs: Allocate btrfs_ioctl_quota_rescan_args on stackfs/ | +4 | 1 reply | |
| 6/7 | btrfs: Allocate btrfs_ioctl_defrag_range_args on stackfs/ | +8 | 1 reply | |
| 7/7 | btrfs: Alloc backref_ctx on stackfs/ | +11 | 1 reply |
Reviews trailers per patch
6 of 7 patches have a Reviewed-by or Acked-by.
| Patch | Anand Jain |
|---|---|
| 1/7 | R-b |
| 2/7 | R-b |
| 3/7 | R-b |
| 4/7 | |
| 5/7 | R-b |
| 6/7 | R-b |
| 7/7 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/7] Change allocation from kmalloc() to stack
Apparently, git send-email --compose missed to send PATCH 0/7. So sending again and hoping it lands in the right place...
Here are some structs which can be converted to allocation on stack in order to save on post-checks on kmalloc() and kfree() each of them.
Sizes of the structures are also in the commit message in case you feel they are too bit to be allocated on stack.
There are two more structs in ioctl.c which can be converted, but I was not sure of them:
1. In create_snapshot(), pending_snapshot can be converted. pending_snapshot is used in the transaction.
2. In btrfs_ioctl_set_received_subvol_32, args64 can be converted, but args32 cannot. All Pointers associated with memdup_user() can also be converted by using copy_from_user() instead. This would include many more structs.
Goldwyn Rodrigues (7):
btrfs: Allocate walk_control on stack
btrfs: Allocate file_ra_state on stack
btrfs: Allocate btrfs_ioctl_get_subvol_info_args on stack
btrfs: Allocate btrfs_ioctl_balance_args on stack
btrfs: Allocate btrfs_ioctl_quota_rescan_args on stack
btrfs: Allocate btrfs_ioctl_defrag_range_args on stack
btrfs: Alloc backref_ctx on stack
fs/btrfs/extent-tree.c | 89 +++++++++++++----------------- fs/btrfs/free-space-cache.c | 12 ++--- fs/btrfs/ioctl.c | 105 ++++++++++++++---------------------- fs/btrfs/send.c | 29 ++++------ 4 files changed, 89 insertions(+), 146 deletions(-)
Signature · 1 line
Goldwyn