提交 b214107e 编写于 作者: C Christoph Hellwig 提交者: Chris Mason

Btrfs: trivial sparse fixes

Fix a bunch of trivial sparse complaints.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 a237d2a2
...@@ -2749,7 +2749,6 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, ...@@ -2749,7 +2749,6 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
BUG_ON(slot < 0); BUG_ON(slot < 0);
if (slot != nritems) { if (slot != nritems) {
int i;
unsigned int old_data = btrfs_item_end_nr(leaf, slot); unsigned int old_data = btrfs_item_end_nr(leaf, slot);
if (old_data < data_end) { if (old_data < data_end) {
...@@ -2913,7 +2912,6 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, ...@@ -2913,7 +2912,6 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
nritems = btrfs_header_nritems(leaf); nritems = btrfs_header_nritems(leaf);
if (slot + nr != nritems) { if (slot + nr != nritems) {
int i;
int data_end = leaf_data_end(root, leaf); int data_end = leaf_data_end(root, leaf);
memmove_extent_buffer(leaf, btrfs_leaf_data(leaf) + memmove_extent_buffer(leaf, btrfs_leaf_data(leaf) +
......
...@@ -3400,10 +3400,8 @@ int try_release_extent_buffer(struct extent_io_tree *tree, struct page *page) ...@@ -3400,10 +3400,8 @@ int try_release_extent_buffer(struct extent_io_tree *tree, struct page *page)
} }
/* at this point we can safely release the extent buffer */ /* at this point we can safely release the extent buffer */
num_pages = num_extent_pages(eb->start, eb->len); num_pages = num_extent_pages(eb->start, eb->len);
for (i = 0; i < num_pages; i++) { for (i = 0; i < num_pages; i++)
struct page *page = extent_buffer_page(eb, i); page_cache_release(extent_buffer_page(eb, i));
page_cache_release(page);
}
rb_erase(&eb->rb_node, &tree->buffer); rb_erase(&eb->rb_node, &tree->buffer);
__free_extent_buffer(eb); __free_extent_buffer(eb);
out: out:
......
...@@ -739,7 +739,7 @@ long btrfs_ioctl_trans_end(struct file *file) ...@@ -739,7 +739,7 @@ long btrfs_ioctl_trans_end(struct file *file)
goto out; goto out;
} }
btrfs_end_transaction(trans, root); btrfs_end_transaction(trans, root);
file->private_data = 0; file->private_data = NULL;
mutex_lock(&root->fs_info->trans_mutex); mutex_lock(&root->fs_info->trans_mutex);
root->fs_info->open_ioctl_trans--; root->fs_info->open_ioctl_trans--;
......
...@@ -254,7 +254,7 @@ void btrfs_sysfs_del_super(struct btrfs_fs_info *fs) ...@@ -254,7 +254,7 @@ void btrfs_sysfs_del_super(struct btrfs_fs_info *fs)
wait_for_completion(&fs->kobj_unregister); wait_for_completion(&fs->kobj_unregister);
} }
int btrfs_init_sysfs() int btrfs_init_sysfs(void)
{ {
btrfs_kset = kset_create_and_add("btrfs", NULL, fs_kobj); btrfs_kset = kset_create_and_add("btrfs", NULL, fs_kobj);
if (!btrfs_kset) if (!btrfs_kset)
...@@ -262,7 +262,7 @@ int btrfs_init_sysfs() ...@@ -262,7 +262,7 @@ int btrfs_init_sysfs()
return 0; return 0;
} }
void btrfs_exit_sysfs() void btrfs_exit_sysfs(void)
{ {
kset_unregister(btrfs_kset); kset_unregister(btrfs_kset);
} }
...@@ -289,12 +289,12 @@ void btrfs_sysfs_del_super(struct btrfs_fs_info *fs) ...@@ -289,12 +289,12 @@ void btrfs_sysfs_del_super(struct btrfs_fs_info *fs)
return; return;
} }
int btrfs_init_sysfs() int btrfs_init_sysfs(void)
{ {
return 0; return 0;
} }
void btrfs_exit_sysfs() void btrfs_exit_sysfs(void)
{ {
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册