OSDN Git Service
(root)
/
sagit-ice-cold
/
kernel_xiaomi_msm8998.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
[sagit-ice-cold/kernel_xiaomi_msm8998.git]
/
fs
/
btrfs
/
inode.c
diff --git
a/fs/btrfs/inode.c
b/fs/btrfs/inode.c
index
bda3c41
..
237da01
100644
(file)
--- a/
fs/btrfs/inode.c
+++ b/
fs/btrfs/inode.c
@@
-1845,8
+1845,10
@@
static int __btrfs_submit_bio_done(struct inode *inode, int rw, struct bio *bio,
int ret;
ret = btrfs_map_bio(root, rw, bio, mirror_num, 1);
int ret;
ret = btrfs_map_bio(root, rw, bio, mirror_num, 1);
- if (ret)
- bio_endio(bio, ret);
+ if (ret) {
+ bio->bi_error = ret;
+ bio_endio(bio);
+ }
return ret;
}
return ret;
}
@@
-1906,8
+1908,10
@@
mapit:
ret = btrfs_map_bio(root, rw, bio, mirror_num, 0);
out:
ret = btrfs_map_bio(root, rw, bio, mirror_num, 0);
out:
- if (ret < 0)
- bio_endio(bio, ret);
+ if (ret < 0) {
+ bio->bi_error = ret;
+ bio_endio(bio);
+ }
return ret;
}
return ret;
}
@@
-7717,13
+7721,13
@@
struct btrfs_retry_complete {
int uptodate;
};
int uptodate;
};
-static void btrfs_retry_endio_nocsum(struct bio *bio
, int err
)
+static void btrfs_retry_endio_nocsum(struct bio *bio)
{
struct btrfs_retry_complete *done = bio->bi_private;
struct bio_vec *bvec;
int i;
{
struct btrfs_retry_complete *done = bio->bi_private;
struct bio_vec *bvec;
int i;
- if (
er
r)
+ if (
bio->bi_erro
r)
goto end;
done->uptodate = 1;
goto end;
done->uptodate = 1;
@@
-7772,7
+7776,7
@@
try_again:
return 0;
}
return 0;
}
-static void btrfs_retry_endio(struct bio *bio
, int err
)
+static void btrfs_retry_endio(struct bio *bio)
{
struct btrfs_retry_complete *done = bio->bi_private;
struct btrfs_io_bio *io_bio = btrfs_io_bio(bio);
{
struct btrfs_retry_complete *done = bio->bi_private;
struct btrfs_io_bio *io_bio = btrfs_io_bio(bio);
@@
-7781,7
+7785,7
@@
static void btrfs_retry_endio(struct bio *bio, int err)
int ret;
int i;
int ret;
int i;
- if (
er
r)
+ if (
bio->bi_erro
r)
goto end;
uptodate = 1;
goto end;
uptodate = 1;
@@
-7864,12
+7868,13
@@
static int btrfs_subio_endio_read(struct inode *inode,
}
}
}
}
-static void btrfs_endio_direct_read(struct bio *bio
, int err
)
+static void btrfs_endio_direct_read(struct bio *bio)
{
struct btrfs_dio_private *dip = bio->bi_private;
struct inode *inode = dip->inode;
struct bio *dio_bio;
struct btrfs_io_bio *io_bio = btrfs_io_bio(bio);
{
struct btrfs_dio_private *dip = bio->bi_private;
struct inode *inode = dip->inode;
struct bio *dio_bio;
struct btrfs_io_bio *io_bio = btrfs_io_bio(bio);
+ int err = bio->bi_error;
if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED)
err = btrfs_subio_endio_read(inode, io_bio, err);
if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED)
err = btrfs_subio_endio_read(inode, io_bio, err);
@@
-7880,17
+7885,14
@@
static void btrfs_endio_direct_read(struct bio *bio, int err)
kfree(dip);
kfree(dip);
- /* If we had a csum failure make sure to clear the uptodate flag */
- if (err)
- clear_bit(BIO_UPTODATE, &dio_bio->bi_flags);
- dio_end_io(dio_bio, err);
+ dio_end_io(dio_bio, bio->bi_error);
if (io_bio->end_io)
io_bio->end_io(io_bio, err);
bio_put(bio);
}
if (io_bio->end_io)
io_bio->end_io(io_bio, err);
bio_put(bio);
}
-static void btrfs_endio_direct_write(struct bio *bio
, int err
)
+static void btrfs_endio_direct_write(struct bio *bio)
{
struct btrfs_dio_private *dip = bio->bi_private;
struct inode *inode = dip->inode;
{
struct btrfs_dio_private *dip = bio->bi_private;
struct inode *inode = dip->inode;
@@
-7904,7
+7906,8
@@
static void btrfs_endio_direct_write(struct bio *bio, int err)
again:
ret = btrfs_dec_test_first_ordered_pending(inode, &ordered,
&ordered_offset,
again:
ret = btrfs_dec_test_first_ordered_pending(inode, &ordered,
&ordered_offset,
- ordered_bytes, !err);
+ ordered_bytes,
+ !bio->bi_error);
if (!ret)
goto out_test;
if (!ret)
goto out_test;
@@
-7927,10
+7930,7
@@
out_test:
kfree(dip);
kfree(dip);
- /* If we had an error make sure to clear the uptodate flag */
- if (err)
- clear_bit(BIO_UPTODATE, &dio_bio->bi_flags);
- dio_end_io(dio_bio, err);
+ dio_end_io(dio_bio, bio->bi_error);
bio_put(bio);
}
bio_put(bio);
}
@@
-7945,9
+7945,10
@@
static int __btrfs_submit_bio_start_direct_io(struct inode *inode, int rw,
return 0;
}
return 0;
}
-static void btrfs_end_dio_bio(struct bio *bio
, int err
)
+static void btrfs_end_dio_bio(struct bio *bio)
{
struct btrfs_dio_private *dip = bio->bi_private;
{
struct btrfs_dio_private *dip = bio->bi_private;
+ int err = bio->bi_error;
if (err)
btrfs_warn(BTRFS_I(dip->inode)->root->fs_info,
if (err)
btrfs_warn(BTRFS_I(dip->inode)->root->fs_info,
@@
-7976,8
+7977,8
@@
static void btrfs_end_dio_bio(struct bio *bio, int err)
if (dip->errors) {
bio_io_error(dip->orig_bio);
} else {
if (dip->errors) {
bio_io_error(dip->orig_bio);
} else {
-
set_bit(BIO_UPTODATE, &dip->dio_bio->bi_flags)
;
- bio_endio(dip->orig_bio
, 0
);
+
dip->dio_bio->bi_error = 0
;
+ bio_endio(dip->orig_bio);
}
out:
bio_put(bio);
}
out:
bio_put(bio);
@@
-7986,9
+7987,8
@@
out:
static struct bio *btrfs_dio_bio_alloc(struct block_device *bdev,
u64 first_sector, gfp_t gfp_flags)
{
static struct bio *btrfs_dio_bio_alloc(struct block_device *bdev,
u64 first_sector, gfp_t gfp_flags)
{
- int nr_vecs = bio_get_nr_vecs(bdev);
struct bio *bio;
struct bio *bio;
- bio = btrfs_bio_alloc(bdev, first_sector,
nr_vecs
, gfp_flags);
+ bio = btrfs_bio_alloc(bdev, first_sector,
BIO_MAX_PAGES
, gfp_flags);
if (bio)
bio_associate_current(bio);
return bio;
if (bio)
bio_associate_current(bio);
return bio;
@@
-8252,7
+8252,8
@@
free_ordered:
* callbacks - they require an allocated dip and a clone of dio_bio.
*/
if (io_bio && dip) {
* callbacks - they require an allocated dip and a clone of dio_bio.
*/
if (io_bio && dip) {
- bio_endio(io_bio, ret);
+ io_bio->bi_error = -EIO;
+ bio_endio(io_bio);
/*
* The end io callbacks free our dip, do the final put on io_bio
* and all the cleanup and final put for dio_bio (through
/*
* The end io callbacks free our dip, do the final put on io_bio
* and all the cleanup and final put for dio_bio (through
@@
-8279,7
+8280,7
@@
free_ordered:
unlock_extent(&BTRFS_I(inode)->io_tree, file_offset,
file_offset + dio_bio->bi_iter.bi_size - 1);
}
unlock_extent(&BTRFS_I(inode)->io_tree, file_offset,
file_offset + dio_bio->bi_iter.bi_size - 1);
}
-
clear_bit(BIO_UPTODATE, &dio_bio->bi_flags)
;
+
dio_bio->bi_error = -EIO
;
/*
* Releases and cleans up our dio_bio, no need to bio_put()
* nor bio_endio()/bio_io_error() against dio_bio.
/*
* Releases and cleans up our dio_bio, no need to bio_put()
* nor bio_endio()/bio_io_error() against dio_bio.