aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/async-thread.c
diff options
context:
space:
mode:
authorDavid Sterba <[email protected]>2019-10-01 17:57:39 +0000
committerDavid Sterba <[email protected]>2019-11-18 11:46:52 +0000
commite1f60a6580c04d0d2492bb6034e968b8c29c78cf (patch)
tree56ef88afaeba63621dafb6b83d8cef6760fd9f35 /fs/btrfs/async-thread.c
parentbtrfs: add const function attribute (diff)
downloadkernel-e1f60a6580c04d0d2492bb6034e968b8c29c78cf.tar.gz
kernel-e1f60a6580c04d0d2492bb6034e968b8c29c78cf.zip
btrfs: add __pure attribute to functions
The attribute is more relaxed than const and the functions could dereference pointers, as long as the observable state is not changed. We do have such functions, based on -Wsuggest-attribute=pure . The visible effects of this patch are negligible, there are differences in the assembly but hard to summarize. Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/async-thread.c')
-rw-r--r--fs/btrfs/async-thread.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index b97ae1b03417..1d32a07bb2d1 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -53,14 +53,12 @@ struct btrfs_workqueue {
struct __btrfs_workqueue *high;
};
-struct btrfs_fs_info *
-btrfs_workqueue_owner(const struct __btrfs_workqueue *wq)
+struct btrfs_fs_info * __pure btrfs_workqueue_owner(const struct __btrfs_workqueue *wq)
{
return wq->fs_info;
}
-struct btrfs_fs_info *
-btrfs_work_owner(const struct btrfs_work *work)
+struct btrfs_fs_info * __pure btrfs_work_owner(const struct btrfs_work *work)
{
return work->wq->fs_info;
}