diff options
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 92 |
1 files changed, 52 insertions, 40 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8b1212e8f7a8..df731c0ebec7 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -1823,7 +1823,7 @@ static void btrfs_clear_bit_hook(struct inode *inode, | |||
1823 | * extent_io.c merge_bio_hook, this must check the chunk tree to make sure | 1823 | * extent_io.c merge_bio_hook, this must check the chunk tree to make sure |
1824 | * we don't create bios that span stripes or chunks | 1824 | * we don't create bios that span stripes or chunks |
1825 | */ | 1825 | */ |
1826 | int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, | 1826 | int btrfs_merge_bio_hook(struct page *page, unsigned long offset, |
1827 | size_t size, struct bio *bio, | 1827 | size_t size, struct bio *bio, |
1828 | unsigned long bio_flags) | 1828 | unsigned long bio_flags) |
1829 | { | 1829 | { |
@@ -1838,7 +1838,7 @@ int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, | |||
1838 | 1838 | ||
1839 | length = bio->bi_iter.bi_size; | 1839 | length = bio->bi_iter.bi_size; |
1840 | map_length = length; | 1840 | map_length = length; |
1841 | ret = btrfs_map_block(root->fs_info, rw, logical, | 1841 | ret = btrfs_map_block(root->fs_info, bio_op(bio), logical, |
1842 | &map_length, NULL, 0); | 1842 | &map_length, NULL, 0); |
1843 | /* Will always return 0 with map_multi == NULL */ | 1843 | /* Will always return 0 with map_multi == NULL */ |
1844 | BUG_ON(ret < 0); | 1844 | BUG_ON(ret < 0); |
@@ -1855,9 +1855,8 @@ int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, | |||
1855 | * At IO completion time the cums attached on the ordered extent record | 1855 | * At IO completion time the cums attached on the ordered extent record |
1856 | * are inserted into the btree | 1856 | * are inserted into the btree |
1857 | */ | 1857 | */ |
1858 | static int __btrfs_submit_bio_start(struct inode *inode, int rw, | 1858 | static int __btrfs_submit_bio_start(struct inode *inode, struct bio *bio, |
1859 | struct bio *bio, int mirror_num, | 1859 | int mirror_num, unsigned long bio_flags, |
1860 | unsigned long bio_flags, | ||
1861 | u64 bio_offset) | 1860 | u64 bio_offset) |
1862 | { | 1861 | { |
1863 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1862 | struct btrfs_root *root = BTRFS_I(inode)->root; |
@@ -1876,14 +1875,14 @@ static int __btrfs_submit_bio_start(struct inode *inode, int rw, | |||
1876 | * At IO completion time the cums attached on the ordered extent record | 1875 | * At IO completion time the cums attached on the ordered extent record |
1877 | * are inserted into the btree | 1876 | * are inserted into the btree |
1878 | */ | 1877 | */ |
1879 | static int __btrfs_submit_bio_done(struct inode *inode, int rw, struct bio *bio, | 1878 | static int __btrfs_submit_bio_done(struct inode *inode, struct bio *bio, |
1880 | int mirror_num, unsigned long bio_flags, | 1879 | int mirror_num, unsigned long bio_flags, |
1881 | u64 bio_offset) | 1880 | u64 bio_offset) |
1882 | { | 1881 | { |
1883 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1882 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1884 | int ret; | 1883 | int ret; |
1885 | 1884 | ||
1886 | ret = btrfs_map_bio(root, rw, bio, mirror_num, 1); | 1885 | ret = btrfs_map_bio(root, bio, mirror_num, 1); |
1887 | if (ret) { | 1886 | if (ret) { |
1888 | bio->bi_error = ret; | 1887 | bio->bi_error = ret; |
1889 | bio_endio(bio); | 1888 | bio_endio(bio); |
@@ -1895,7 +1894,7 @@ static int __btrfs_submit_bio_done(struct inode *inode, int rw, struct bio *bio, | |||
1895 | * extent_io.c submission hook. This does the right thing for csum calculation | 1894 | * extent_io.c submission hook. This does the right thing for csum calculation |
1896 | * on write, or reading the csums from the tree before a read | 1895 | * on write, or reading the csums from the tree before a read |
1897 | */ | 1896 | */ |
1898 | static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, | 1897 | static int btrfs_submit_bio_hook(struct inode *inode, struct bio *bio, |
1899 | int mirror_num, unsigned long bio_flags, | 1898 | int mirror_num, unsigned long bio_flags, |
1900 | u64 bio_offset) | 1899 | u64 bio_offset) |
1901 | { | 1900 | { |
@@ -1910,7 +1909,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, | |||
1910 | if (btrfs_is_free_space_inode(inode)) | 1909 | if (btrfs_is_free_space_inode(inode)) |
1911 | metadata = BTRFS_WQ_ENDIO_FREE_SPACE; | 1910 | metadata = BTRFS_WQ_ENDIO_FREE_SPACE; |
1912 | 1911 | ||
1913 | if (!(rw & REQ_WRITE)) { | 1912 | if (bio_op(bio) != REQ_OP_WRITE) { |
1914 | ret = btrfs_bio_wq_end_io(root->fs_info, bio, metadata); | 1913 | ret = btrfs_bio_wq_end_io(root->fs_info, bio, metadata); |
1915 | if (ret) | 1914 | if (ret) |
1916 | goto out; | 1915 | goto out; |
@@ -1932,7 +1931,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, | |||
1932 | goto mapit; | 1931 | goto mapit; |
1933 | /* we're doing a write, do the async checksumming */ | 1932 | /* we're doing a write, do the async checksumming */ |
1934 | ret = btrfs_wq_submit_bio(BTRFS_I(inode)->root->fs_info, | 1933 | ret = btrfs_wq_submit_bio(BTRFS_I(inode)->root->fs_info, |
1935 | inode, rw, bio, mirror_num, | 1934 | inode, bio, mirror_num, |
1936 | bio_flags, bio_offset, | 1935 | bio_flags, bio_offset, |
1937 | __btrfs_submit_bio_start, | 1936 | __btrfs_submit_bio_start, |
1938 | __btrfs_submit_bio_done); | 1937 | __btrfs_submit_bio_done); |
@@ -1944,7 +1943,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, | |||
1944 | } | 1943 | } |
1945 | 1944 | ||
1946 | mapit: | 1945 | mapit: |
1947 | ret = btrfs_map_bio(root, rw, bio, mirror_num, 0); | 1946 | ret = btrfs_map_bio(root, bio, mirror_num, 0); |
1948 | 1947 | ||
1949 | out: | 1948 | out: |
1950 | if (ret < 0) { | 1949 | if (ret < 0) { |
@@ -3271,7 +3270,16 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode) | |||
3271 | /* grab metadata reservation from transaction handle */ | 3270 | /* grab metadata reservation from transaction handle */ |
3272 | if (reserve) { | 3271 | if (reserve) { |
3273 | ret = btrfs_orphan_reserve_metadata(trans, inode); | 3272 | ret = btrfs_orphan_reserve_metadata(trans, inode); |
3274 | BUG_ON(ret); /* -ENOSPC in reservation; Logic error? JDM */ | 3273 | ASSERT(!ret); |
3274 | if (ret) { | ||
3275 | atomic_dec(&root->orphan_inodes); | ||
3276 | clear_bit(BTRFS_INODE_ORPHAN_META_RESERVED, | ||
3277 | &BTRFS_I(inode)->runtime_flags); | ||
3278 | if (insert) | ||
3279 | clear_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, | ||
3280 | &BTRFS_I(inode)->runtime_flags); | ||
3281 | return ret; | ||
3282 | } | ||
3275 | } | 3283 | } |
3276 | 3284 | ||
3277 | /* insert an orphan item to track this unlinked/truncated file */ | 3285 | /* insert an orphan item to track this unlinked/truncated file */ |
@@ -4549,6 +4557,7 @@ delete: | |||
4549 | BUG_ON(ret); | 4557 | BUG_ON(ret); |
4550 | if (btrfs_should_throttle_delayed_refs(trans, root)) | 4558 | if (btrfs_should_throttle_delayed_refs(trans, root)) |
4551 | btrfs_async_run_delayed_refs(root, | 4559 | btrfs_async_run_delayed_refs(root, |
4560 | trans->transid, | ||
4552 | trans->delayed_ref_updates * 2, 0); | 4561 | trans->delayed_ref_updates * 2, 0); |
4553 | if (be_nice) { | 4562 | if (be_nice) { |
4554 | if (truncate_space_check(trans, root, | 4563 | if (truncate_space_check(trans, root, |
@@ -5748,6 +5757,7 @@ static int btrfs_real_readdir(struct file *file, struct dir_context *ctx) | |||
5748 | int name_len; | 5757 | int name_len; |
5749 | int is_curr = 0; /* ctx->pos points to the current index? */ | 5758 | int is_curr = 0; /* ctx->pos points to the current index? */ |
5750 | bool emitted; | 5759 | bool emitted; |
5760 | bool put = false; | ||
5751 | 5761 | ||
5752 | /* FIXME, use a real flag for deciding about the key type */ | 5762 | /* FIXME, use a real flag for deciding about the key type */ |
5753 | if (root->fs_info->tree_root == root) | 5763 | if (root->fs_info->tree_root == root) |
@@ -5765,7 +5775,8 @@ static int btrfs_real_readdir(struct file *file, struct dir_context *ctx) | |||
5765 | if (key_type == BTRFS_DIR_INDEX_KEY) { | 5775 | if (key_type == BTRFS_DIR_INDEX_KEY) { |
5766 | INIT_LIST_HEAD(&ins_list); | 5776 | INIT_LIST_HEAD(&ins_list); |
5767 | INIT_LIST_HEAD(&del_list); | 5777 | INIT_LIST_HEAD(&del_list); |
5768 | btrfs_get_delayed_items(inode, &ins_list, &del_list); | 5778 | put = btrfs_readdir_get_delayed_items(inode, &ins_list, |
5779 | &del_list); | ||
5769 | } | 5780 | } |
5770 | 5781 | ||
5771 | key.type = key_type; | 5782 | key.type = key_type; |
@@ -5912,8 +5923,8 @@ next: | |||
5912 | nopos: | 5923 | nopos: |
5913 | ret = 0; | 5924 | ret = 0; |
5914 | err: | 5925 | err: |
5915 | if (key_type == BTRFS_DIR_INDEX_KEY) | 5926 | if (put) |
5916 | btrfs_put_delayed_items(&ins_list, &del_list); | 5927 | btrfs_readdir_put_delayed_items(inode, &ins_list, &del_list); |
5917 | btrfs_free_path(path); | 5928 | btrfs_free_path(path); |
5918 | return ret; | 5929 | return ret; |
5919 | } | 5930 | } |
@@ -7778,12 +7789,12 @@ err: | |||
7778 | } | 7789 | } |
7779 | 7790 | ||
7780 | static inline int submit_dio_repair_bio(struct inode *inode, struct bio *bio, | 7791 | static inline int submit_dio_repair_bio(struct inode *inode, struct bio *bio, |
7781 | int rw, int mirror_num) | 7792 | int mirror_num) |
7782 | { | 7793 | { |
7783 | struct btrfs_root *root = BTRFS_I(inode)->root; | 7794 | struct btrfs_root *root = BTRFS_I(inode)->root; |
7784 | int ret; | 7795 | int ret; |
7785 | 7796 | ||
7786 | BUG_ON(rw & REQ_WRITE); | 7797 | BUG_ON(bio_op(bio) == REQ_OP_WRITE); |
7787 | 7798 | ||
7788 | bio_get(bio); | 7799 | bio_get(bio); |
7789 | 7800 | ||
@@ -7792,7 +7803,7 @@ static inline int submit_dio_repair_bio(struct inode *inode, struct bio *bio, | |||
7792 | if (ret) | 7803 | if (ret) |
7793 | goto err; | 7804 | goto err; |
7794 | 7805 | ||
7795 | ret = btrfs_map_bio(root, rw, bio, mirror_num, 0); | 7806 | ret = btrfs_map_bio(root, bio, mirror_num, 0); |
7796 | err: | 7807 | err: |
7797 | bio_put(bio); | 7808 | bio_put(bio); |
7798 | return ret; | 7809 | return ret; |
@@ -7843,7 +7854,7 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio, | |||
7843 | int read_mode; | 7854 | int read_mode; |
7844 | int ret; | 7855 | int ret; |
7845 | 7856 | ||
7846 | BUG_ON(failed_bio->bi_rw & REQ_WRITE); | 7857 | BUG_ON(bio_op(failed_bio) == REQ_OP_WRITE); |
7847 | 7858 | ||
7848 | ret = btrfs_get_io_failure_record(inode, start, end, &failrec); | 7859 | ret = btrfs_get_io_failure_record(inode, start, end, &failrec); |
7849 | if (ret) | 7860 | if (ret) |
@@ -7871,13 +7882,13 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio, | |||
7871 | free_io_failure(inode, failrec); | 7882 | free_io_failure(inode, failrec); |
7872 | return -EIO; | 7883 | return -EIO; |
7873 | } | 7884 | } |
7885 | bio_set_op_attrs(bio, REQ_OP_READ, read_mode); | ||
7874 | 7886 | ||
7875 | btrfs_debug(BTRFS_I(inode)->root->fs_info, | 7887 | btrfs_debug(BTRFS_I(inode)->root->fs_info, |
7876 | "Repair DIO Read Error: submitting new dio read[%#x] to this_mirror=%d, in_validation=%d\n", | 7888 | "Repair DIO Read Error: submitting new dio read[%#x] to this_mirror=%d, in_validation=%d\n", |
7877 | read_mode, failrec->this_mirror, failrec->in_validation); | 7889 | read_mode, failrec->this_mirror, failrec->in_validation); |
7878 | 7890 | ||
7879 | ret = submit_dio_repair_bio(inode, bio, read_mode, | 7891 | ret = submit_dio_repair_bio(inode, bio, failrec->this_mirror); |
7880 | failrec->this_mirror); | ||
7881 | if (ret) { | 7892 | if (ret) { |
7882 | free_io_failure(inode, failrec); | 7893 | free_io_failure(inode, failrec); |
7883 | bio_put(bio); | 7894 | bio_put(bio); |
@@ -8167,7 +8178,7 @@ static void btrfs_endio_direct_write(struct bio *bio) | |||
8167 | bio_put(bio); | 8178 | bio_put(bio); |
8168 | } | 8179 | } |
8169 | 8180 | ||
8170 | static int __btrfs_submit_bio_start_direct_io(struct inode *inode, int rw, | 8181 | static int __btrfs_submit_bio_start_direct_io(struct inode *inode, |
8171 | struct bio *bio, int mirror_num, | 8182 | struct bio *bio, int mirror_num, |
8172 | unsigned long bio_flags, u64 offset) | 8183 | unsigned long bio_flags, u64 offset) |
8173 | { | 8184 | { |
@@ -8185,8 +8196,8 @@ static void btrfs_end_dio_bio(struct bio *bio) | |||
8185 | 8196 | ||
8186 | if (err) | 8197 | if (err) |
8187 | btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, | 8198 | btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, |
8188 | "direct IO failed ino %llu rw %lu sector %#Lx len %u err no %d", | 8199 | "direct IO failed ino %llu rw %d,%u sector %#Lx len %u err no %d", |
8189 | btrfs_ino(dip->inode), bio->bi_rw, | 8200 | btrfs_ino(dip->inode), bio_op(bio), bio->bi_rw, |
8190 | (unsigned long long)bio->bi_iter.bi_sector, | 8201 | (unsigned long long)bio->bi_iter.bi_sector, |
8191 | bio->bi_iter.bi_size, err); | 8202 | bio->bi_iter.bi_size, err); |
8192 | 8203 | ||
@@ -8260,11 +8271,11 @@ static inline int btrfs_lookup_and_bind_dio_csum(struct btrfs_root *root, | |||
8260 | } | 8271 | } |
8261 | 8272 | ||
8262 | static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, | 8273 | static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, |
8263 | int rw, u64 file_offset, int skip_sum, | 8274 | u64 file_offset, int skip_sum, |
8264 | int async_submit) | 8275 | int async_submit) |
8265 | { | 8276 | { |
8266 | struct btrfs_dio_private *dip = bio->bi_private; | 8277 | struct btrfs_dio_private *dip = bio->bi_private; |
8267 | int write = rw & REQ_WRITE; | 8278 | bool write = bio_op(bio) == REQ_OP_WRITE; |
8268 | struct btrfs_root *root = BTRFS_I(inode)->root; | 8279 | struct btrfs_root *root = BTRFS_I(inode)->root; |
8269 | int ret; | 8280 | int ret; |
8270 | 8281 | ||
@@ -8285,8 +8296,7 @@ static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, | |||
8285 | 8296 | ||
8286 | if (write && async_submit) { | 8297 | if (write && async_submit) { |
8287 | ret = btrfs_wq_submit_bio(root->fs_info, | 8298 | ret = btrfs_wq_submit_bio(root->fs_info, |
8288 | inode, rw, bio, 0, 0, | 8299 | inode, bio, 0, 0, file_offset, |
8289 | file_offset, | ||
8290 | __btrfs_submit_bio_start_direct_io, | 8300 | __btrfs_submit_bio_start_direct_io, |
8291 | __btrfs_submit_bio_done); | 8301 | __btrfs_submit_bio_done); |
8292 | goto err; | 8302 | goto err; |
@@ -8305,13 +8315,13 @@ static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, | |||
8305 | goto err; | 8315 | goto err; |
8306 | } | 8316 | } |
8307 | map: | 8317 | map: |
8308 | ret = btrfs_map_bio(root, rw, bio, 0, async_submit); | 8318 | ret = btrfs_map_bio(root, bio, 0, async_submit); |
8309 | err: | 8319 | err: |
8310 | bio_put(bio); | 8320 | bio_put(bio); |
8311 | return ret; | 8321 | return ret; |
8312 | } | 8322 | } |
8313 | 8323 | ||
8314 | static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, | 8324 | static int btrfs_submit_direct_hook(struct btrfs_dio_private *dip, |
8315 | int skip_sum) | 8325 | int skip_sum) |
8316 | { | 8326 | { |
8317 | struct inode *inode = dip->inode; | 8327 | struct inode *inode = dip->inode; |
@@ -8330,8 +8340,8 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, | |||
8330 | int i; | 8340 | int i; |
8331 | 8341 | ||
8332 | map_length = orig_bio->bi_iter.bi_size; | 8342 | map_length = orig_bio->bi_iter.bi_size; |
8333 | ret = btrfs_map_block(root->fs_info, rw, start_sector << 9, | 8343 | ret = btrfs_map_block(root->fs_info, bio_op(orig_bio), |
8334 | &map_length, NULL, 0); | 8344 | start_sector << 9, &map_length, NULL, 0); |
8335 | if (ret) | 8345 | if (ret) |
8336 | return -EIO; | 8346 | return -EIO; |
8337 | 8347 | ||
@@ -8351,6 +8361,7 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, | |||
8351 | if (!bio) | 8361 | if (!bio) |
8352 | return -ENOMEM; | 8362 | return -ENOMEM; |
8353 | 8363 | ||
8364 | bio_set_op_attrs(bio, bio_op(orig_bio), orig_bio->bi_rw); | ||
8354 | bio->bi_private = dip; | 8365 | bio->bi_private = dip; |
8355 | bio->bi_end_io = btrfs_end_dio_bio; | 8366 | bio->bi_end_io = btrfs_end_dio_bio; |
8356 | btrfs_io_bio(bio)->logical = file_offset; | 8367 | btrfs_io_bio(bio)->logical = file_offset; |
@@ -8370,7 +8381,7 @@ next_block: | |||
8370 | * before we're done setting it up | 8381 | * before we're done setting it up |
8371 | */ | 8382 | */ |
8372 | atomic_inc(&dip->pending_bios); | 8383 | atomic_inc(&dip->pending_bios); |
8373 | ret = __btrfs_submit_dio_bio(bio, inode, rw, | 8384 | ret = __btrfs_submit_dio_bio(bio, inode, |
8374 | file_offset, skip_sum, | 8385 | file_offset, skip_sum, |
8375 | async_submit); | 8386 | async_submit); |
8376 | if (ret) { | 8387 | if (ret) { |
@@ -8388,12 +8399,13 @@ next_block: | |||
8388 | start_sector, GFP_NOFS); | 8399 | start_sector, GFP_NOFS); |
8389 | if (!bio) | 8400 | if (!bio) |
8390 | goto out_err; | 8401 | goto out_err; |
8402 | bio_set_op_attrs(bio, bio_op(orig_bio), orig_bio->bi_rw); | ||
8391 | bio->bi_private = dip; | 8403 | bio->bi_private = dip; |
8392 | bio->bi_end_io = btrfs_end_dio_bio; | 8404 | bio->bi_end_io = btrfs_end_dio_bio; |
8393 | btrfs_io_bio(bio)->logical = file_offset; | 8405 | btrfs_io_bio(bio)->logical = file_offset; |
8394 | 8406 | ||
8395 | map_length = orig_bio->bi_iter.bi_size; | 8407 | map_length = orig_bio->bi_iter.bi_size; |
8396 | ret = btrfs_map_block(root->fs_info, rw, | 8408 | ret = btrfs_map_block(root->fs_info, bio_op(orig_bio), |
8397 | start_sector << 9, | 8409 | start_sector << 9, |
8398 | &map_length, NULL, 0); | 8410 | &map_length, NULL, 0); |
8399 | if (ret) { | 8411 | if (ret) { |
@@ -8413,7 +8425,7 @@ next_block: | |||
8413 | } | 8425 | } |
8414 | 8426 | ||
8415 | submit: | 8427 | submit: |
8416 | ret = __btrfs_submit_dio_bio(bio, inode, rw, file_offset, skip_sum, | 8428 | ret = __btrfs_submit_dio_bio(bio, inode, file_offset, skip_sum, |
8417 | async_submit); | 8429 | async_submit); |
8418 | if (!ret) | 8430 | if (!ret) |
8419 | return 0; | 8431 | return 0; |
@@ -8433,14 +8445,14 @@ out_err: | |||
8433 | return 0; | 8445 | return 0; |
8434 | } | 8446 | } |
8435 | 8447 | ||
8436 | static void btrfs_submit_direct(int rw, struct bio *dio_bio, | 8448 | static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode, |
8437 | struct inode *inode, loff_t file_offset) | 8449 | loff_t file_offset) |
8438 | { | 8450 | { |
8439 | struct btrfs_dio_private *dip = NULL; | 8451 | struct btrfs_dio_private *dip = NULL; |
8440 | struct bio *io_bio = NULL; | 8452 | struct bio *io_bio = NULL; |
8441 | struct btrfs_io_bio *btrfs_bio; | 8453 | struct btrfs_io_bio *btrfs_bio; |
8442 | int skip_sum; | 8454 | int skip_sum; |
8443 | int write = rw & REQ_WRITE; | 8455 | bool write = (bio_op(dio_bio) == REQ_OP_WRITE); |
8444 | int ret = 0; | 8456 | int ret = 0; |
8445 | 8457 | ||
8446 | skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; | 8458 | skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; |
@@ -8491,7 +8503,7 @@ static void btrfs_submit_direct(int rw, struct bio *dio_bio, | |||
8491 | dio_data->unsubmitted_oe_range_end; | 8503 | dio_data->unsubmitted_oe_range_end; |
8492 | } | 8504 | } |
8493 | 8505 | ||
8494 | ret = btrfs_submit_direct_hook(rw, dip, skip_sum); | 8506 | ret = btrfs_submit_direct_hook(dip, skip_sum); |
8495 | if (!ret) | 8507 | if (!ret) |
8496 | return; | 8508 | return; |
8497 | 8509 | ||
@@ -10525,7 +10537,7 @@ static const struct inode_operations btrfs_dir_ro_inode_operations = { | |||
10525 | static const struct file_operations btrfs_dir_file_operations = { | 10537 | static const struct file_operations btrfs_dir_file_operations = { |
10526 | .llseek = generic_file_llseek, | 10538 | .llseek = generic_file_llseek, |
10527 | .read = generic_read_dir, | 10539 | .read = generic_read_dir, |
10528 | .iterate = btrfs_real_readdir, | 10540 | .iterate_shared = btrfs_real_readdir, |
10529 | .unlocked_ioctl = btrfs_ioctl, | 10541 | .unlocked_ioctl = btrfs_ioctl, |
10530 | #ifdef CONFIG_COMPAT | 10542 | #ifdef CONFIG_COMPAT |
10531 | .compat_ioctl = btrfs_compat_ioctl, | 10543 | .compat_ioctl = btrfs_compat_ioctl, |