diff options
| author | Michael Ellerman <mpe@ellerman.id.au> | 2017-07-31 20:20:29 +1000 | 
|---|---|---|
| committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-07-31 20:20:29 +1000 | 
| commit | bb272221e9db79f13d454e1f3fb6b05013be985e (patch) | |
| tree | 36f4acc50e3fabac71fadd34c720c0a6011db470 /include/linux/bio.h | |
| parent | 253fd51e2f533552ae35a0c661705da6c4842c1b (diff) | |
| parent | 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff) | |
Merge tag 'v4.13-rc1' into fixes
The fixes branch is based off a random pre-rc1 commit, because we had
some fixes that needed to go in before rc1 was released.
However we now need to fix some code that went in after that point, but
before rc1, so merge rc1 to get that code into fixes so we can fix it!
Diffstat (limited to 'include/linux/bio.h')
| -rw-r--r-- | include/linux/bio.h | 47 | 
1 files changed, 24 insertions, 23 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 664a27da276d..7b1cf4ba0902 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -165,10 +165,27 @@ static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter,  {  	iter->bi_sector += bytes >> 9; -	if (bio_no_advance_iter(bio)) +	if (bio_no_advance_iter(bio)) {  		iter->bi_size -= bytes; -	else +		iter->bi_done += bytes; +	} else {  		bvec_iter_advance(bio->bi_io_vec, iter, bytes); +		/* TODO: It is reasonable to complete bio with error here. */ +	} +} + +static inline bool bio_rewind_iter(struct bio *bio, struct bvec_iter *iter, +		unsigned int bytes) +{ +	iter->bi_sector -= bytes >> 9; + +	if (bio_no_advance_iter(bio)) { +		iter->bi_size += bytes; +		iter->bi_done -= bytes; +		return true; +	} + +	return bvec_iter_rewind(bio->bi_io_vec, iter, bytes);  }  #define __bio_for_each_segment(bvl, bio, iter, start)			\ @@ -303,8 +320,6 @@ struct bio_integrity_payload {  	struct bvec_iter	bip_iter; -	bio_end_io_t		*bip_end_io;	/* saved I/O completion fn */ -  	unsigned short		bip_slab;	/* slab the bip came from */  	unsigned short		bip_vcnt;	/* # of integrity bio_vecs */  	unsigned short		bip_max_vcnt;	/* integrity bio_vec slots */ @@ -722,13 +737,10 @@ struct biovec_slab {  		bip_for_each_vec(_bvl, _bio->bi_integrity, _iter)  extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); -extern void bio_integrity_free(struct bio *);  extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int); -extern bool bio_integrity_enabled(struct bio *bio); -extern int bio_integrity_prep(struct bio *); -extern void bio_integrity_endio(struct bio *); +extern bool bio_integrity_prep(struct bio *);  extern void bio_integrity_advance(struct bio *, unsigned int); -extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); +extern void bio_integrity_trim(struct bio *);  extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t);  extern int bioset_integrity_create(struct bio_set *, int);  extern void bioset_integrity_free(struct bio_set *); @@ -741,11 +753,6 @@ static inline void *bio_integrity(struct bio *bio)  	return NULL;  } -static inline bool bio_integrity_enabled(struct bio *bio) -{ -	return false; -} -  static inline int bioset_integrity_create(struct bio_set *bs, int pool_size)  {  	return 0; @@ -756,14 +763,9 @@ static inline void bioset_integrity_free (struct bio_set *bs)  	return;  } -static inline int bio_integrity_prep(struct bio *bio) -{ -	return 0; -} - -static inline void bio_integrity_free(struct bio *bio) +static inline bool bio_integrity_prep(struct bio *bio)  { -	return; +	return true;  }  static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src, @@ -778,8 +780,7 @@ static inline void bio_integrity_advance(struct bio *bio,  	return;  } -static inline void bio_integrity_trim(struct bio *bio, unsigned int offset, -				      unsigned int sectors) +static inline void bio_integrity_trim(struct bio *bio)  {  	return;  }  | 
