diff options
Diffstat (limited to 'fs/btrfs/delayed-inode.c')
-rw-r--r-- | fs/btrfs/delayed-inode.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index f26f38ccd194..375510913fe7 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c | |||
@@ -535,20 +535,6 @@ static struct btrfs_delayed_item *__btrfs_next_delayed_item( | |||
535 | return next; | 535 | return next; |
536 | } | 536 | } |
537 | 537 | ||
538 | static inline struct btrfs_root *btrfs_get_fs_root(struct btrfs_root *root, | ||
539 | u64 root_id) | ||
540 | { | ||
541 | struct btrfs_key root_key; | ||
542 | |||
543 | if (root->objectid == root_id) | ||
544 | return root; | ||
545 | |||
546 | root_key.objectid = root_id; | ||
547 | root_key.type = BTRFS_ROOT_ITEM_KEY; | ||
548 | root_key.offset = (u64)-1; | ||
549 | return btrfs_read_fs_root_no_name(root->fs_info, &root_key); | ||
550 | } | ||
551 | |||
552 | static int btrfs_delayed_item_reserve_metadata(struct btrfs_trans_handle *trans, | 538 | static int btrfs_delayed_item_reserve_metadata(struct btrfs_trans_handle *trans, |
553 | struct btrfs_root *root, | 539 | struct btrfs_root *root, |
554 | struct btrfs_delayed_item *item) | 540 | struct btrfs_delayed_item *item) |
@@ -1681,8 +1667,7 @@ int btrfs_should_delete_dir_index(struct list_head *del_list, | |||
1681 | * btrfs_readdir_delayed_dir_index - read dir info stored in the delayed tree | 1667 | * btrfs_readdir_delayed_dir_index - read dir info stored in the delayed tree |
1682 | * | 1668 | * |
1683 | */ | 1669 | */ |
1684 | int btrfs_readdir_delayed_dir_index(struct file *filp, void *dirent, | 1670 | int btrfs_readdir_delayed_dir_index(struct dir_context *ctx, |
1685 | filldir_t filldir, | ||
1686 | struct list_head *ins_list) | 1671 | struct list_head *ins_list) |
1687 | { | 1672 | { |
1688 | struct btrfs_dir_item *di; | 1673 | struct btrfs_dir_item *di; |
@@ -1704,13 +1689,13 @@ int btrfs_readdir_delayed_dir_index(struct file *filp, void *dirent, | |||
1704 | list_for_each_entry_safe(curr, next, ins_list, readdir_list) { | 1689 | list_for_each_entry_safe(curr, next, ins_list, readdir_list) { |
1705 | list_del(&curr->readdir_list); | 1690 | list_del(&curr->readdir_list); |
1706 | 1691 | ||
1707 | if (curr->key.offset < filp->f_pos) { | 1692 | if (curr->key.offset < ctx->pos) { |
1708 | if (atomic_dec_and_test(&curr->refs)) | 1693 | if (atomic_dec_and_test(&curr->refs)) |
1709 | kfree(curr); | 1694 | kfree(curr); |
1710 | continue; | 1695 | continue; |
1711 | } | 1696 | } |
1712 | 1697 | ||
1713 | filp->f_pos = curr->key.offset; | 1698 | ctx->pos = curr->key.offset; |
1714 | 1699 | ||
1715 | di = (struct btrfs_dir_item *)curr->data; | 1700 | di = (struct btrfs_dir_item *)curr->data; |
1716 | name = (char *)(di + 1); | 1701 | name = (char *)(di + 1); |
@@ -1719,7 +1704,7 @@ int btrfs_readdir_delayed_dir_index(struct file *filp, void *dirent, | |||
1719 | d_type = btrfs_filetype_table[di->type]; | 1704 | d_type = btrfs_filetype_table[di->type]; |
1720 | btrfs_disk_key_to_cpu(&location, &di->location); | 1705 | btrfs_disk_key_to_cpu(&location, &di->location); |
1721 | 1706 | ||
1722 | over = filldir(dirent, name, name_len, curr->key.offset, | 1707 | over = !dir_emit(ctx, name, name_len, |
1723 | location.objectid, d_type); | 1708 | location.objectid, d_type); |
1724 | 1709 | ||
1725 | if (atomic_dec_and_test(&curr->refs)) | 1710 | if (atomic_dec_and_test(&curr->refs)) |