Re: [patch 2/5] signalfd v2 - signalfd core ...

2007-03-09 Thread Kent Overstreet
On 3/8/07, Linus Torvalds [EMAIL PROTECTED] wrote: Which is why you introduced a new system call, but that leads to all the problems with the file descriptor no longer being *usable*. Think scripts. It's easy to do reads in perl scripts, and parse the output. In contrast, making perl use a new

[PATCH v3 00/26] Prep work for immutable bio vecs

2012-09-24 Thread Kent Overstreet
abstracting out the bio iterator, I think. Kent Overstreet (26): block: Fix a buffer overrun in bio_integrity_split() block: Convert integrity to bvec_alloc_bs() block: Add bio_advance() block: Refactor blk_update_request() md: Convert md_trim_bio() to use bio_advance() block: Add

[PATCH v3 03/26] block: Add bio_advance()

2012-09-24 Thread Kent Overstreet
This is prep work for immutable bio vecs; we first want to centralize where bvecs are modified. Next two patches convert some existing code to use this function. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c| 41

[PATCH v3 08/26] block: Change bio_split() to respect the current value of bi_idx

2012-09-24 Thread Kent Overstreet
partial completed bios to be submitted, which along with immutable biovecs enables effecient bio splitting. Some of the callers were (double) checking that bios could be split, so update their checks too. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC

[PATCH v3 24/26] block: Add an explicit bio flag for bios that own their bvec

2012-09-24 Thread Kent Overstreet
This is for the new bio splitting code. When we split a bio, if the split occured on a bvec boundry we reuse the bvec for the new bio. But that means bio_free() can't free it, hence the explicit flag. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk Acked

[PATCH v3 26/26] block: Add BIO_SUBMITTED flag, kill BIO_CLONED

2012-09-24 Thread Kent Overstreet
for the new flag. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Alasdair Kergon a...@redhat.com CC: dm-de...@redhat.com CC: Martin K. Petersen martin.peter...@oracle.com --- block/blk-core.c | 2 ++ drivers/md/dm.c | 1 - fs/bio

[PATCH v3 16/26] block: Add bio_copy_data()

2012-09-24 Thread Kent Overstreet
This gets open coded quite a bit and it's tricky to get right, so make a generic version and convert some existing users over to it instead. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c| 70

[PATCH v3 17/26] pktcdvd: use bio_copy_data()

2012-09-24 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Jiri Kosina jkos...@suse.cz --- drivers/block/pktcdvd.c | 79 - 1 file changed, 12 insertions(+), 67 deletions(-) diff --git a/drivers/block/pktcdvd.c b

[PATCH v3 25/26] bio-integrity: Add explicit field for owner of bip_buf

2012-09-24 Thread Kent Overstreet
This was the only real user of BIO_CLONED, which didn't have very clear semantics. Convert to its own flag so we can get rid of BIO_CLONED. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Martin K. Petersen martin.peter...@oracle.com --- fs/bio

[PATCH v3 23/26] block: Add bio_alloc_pages()

2012-09-24 Thread Kent Overstreet
More utility code to replace stuff that's getting open coded. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 16 +++- fs/bio.c| 28 include/linux/bio.h

[PATCH v3 22/26] block: Convert some code to bio_for_each_segment_all()

2012-09-24 Thread Kent Overstreet
pass in a struct bio_vec (not a pointer) which is updated with what the current biovec would be (taking into account bi_bvec_done and bi_size). So because of that it's more worthwhile to be consistent about bio_for_each_segment()/bio_for_each_segment_all() usage. Signed-off-by: Kent Overstreet

[PATCH v3 15/26] raid1: Refactor narrow_write_error() to not use bi_idx

2012-09-24 Thread Kent Overstreet
More bi_idx removal. This code was just open coding bio_clone(). This could probably be further improved by using bio_advance() instead of skipping over null pages, but that'd be a larger rework. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne

[PATCH v3 21/26] block: Add bio_for_each_segment_all()

2012-09-24 Thread Kent Overstreet
implementation. This will also help document the intent of code that's using it - bio_for_each_segment_all() is only legal to use for code that owns the bio. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Neil Brown ne...@suse.de CC: Boaz Harrosh bharr

[PATCH v3 20/26] bounce: Refactor __blk_queue_bounce to not use bi_io_vec

2012-09-24 Thread Kent Overstreet
- a later patch renames __bio_for_each_segment() - bio_for_each_segment_all(), and documents that bio_for_each_segment_all() is only for code that owns the bio. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- mm/bounce.c | 73

[PATCH v3 19/26] raid1: use bio_copy_data()

2012-09-24 Thread Kent Overstreet
This doesn't really delete any code _yet_, but once immutable bvecs are done we can just delete the rest of the code in that loop. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 5 ++--- 1 file changed, 2

[PATCH v3 18/26] pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage

2012-09-24 Thread Kent Overstreet
In the short term this'll help with code auditing, and if this code ever gets used now it's converted :) Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jiri Kosina jkos...@suse.cz --- drivers/block/pktcdvd.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff

[PATCH v3 07/26] block: Use bio_sectors() more consistently

2012-09-24 Thread Kent Overstreet
Bunch of places in the code weren't using it where they could be - this'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Ed L. Cashin ecas...@coraid.com CC: Nick

[PATCH v3 14/26] raid5: use bio_reset()

2012-09-24 Thread Kent Overstreet
Had to shuffle the code around a bit (where bi_rw and bi_end_io were set), but shouldn't really be anything tricky here Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid5.c | 27 +-- 1 file

[PATCH v3 13/26] raid1: use bio_reset()

2012-09-24 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 28f506a..4614b9e

[PATCH v3 12/26] raid10: Use bio_reset()

2012-09-24 Thread Kent Overstreet
More prep work for immutable bio vecs, mainly getting rid of references to bi_idx. bio_reset was being open coded in a few places. The one in sync_request was a bit nontrivial to convert, so could use some extra eyeballs. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax

[PATCH v3 11/26] block: Add submit_bio_wait(), remove from md

2012-09-24 Thread Kent Overstreet
Random cleanup - this code was duplicated and it's not really specific to md. Also added the ability to return the actual error code. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de Acked-by: Tejun Heo t...@kernel.org --- drivers

[PATCH v3 09/26] block: Remove bi_idx references

2012-09-24 Thread Kent Overstreet
For immutable bvecs, all bi_idx usage needs to be audited - so here we're removing all the unnecessary uses. Most of these are places where it was being initialized on a bio that was just allocated, a few others are conversions to standard macros. Signed-off-by: Kent Overstreet koverstr

[PATCH v3 06/26] block: Add bio_end_sector()

2012-09-24 Thread Kent Overstreet
Just a little convenience macro - main reason to add it now is preparing for immutable bio vecs, it'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Lars Ellenberg

[PATCH v3 10/26] block: Remove some unnecessary bi_vcnt usage

2012-09-24 Thread Kent Overstreet
More prep work for immutable bvecs/effecient bio splitting - usage of bi_vcnt has to be auditing, so getting rid of all the unnecessary usage makes that easier. Plus, bio_segments() is really what this code wanted, as it respects the current value of bi_idx. Signed-off-by: Kent Overstreet

[PATCH v3 05/26] md: Convert md_trim_bio() to use bio_advance()

2012-09-24 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/md.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 7a2b079..51ce48c 100644

[PATCH v3 02/26] block: Convert integrity to bvec_alloc_bs()

2012-09-24 Thread Kent Overstreet
a different mempool for its bvecs, and thus avoid a potential deadlock. This is eventually for immutable bio vecs - immutable bvecs aren't useful if we still have to copy them, hence the need for the pointer. Less code is always nice too, though. Signed-off-by: Kent Overstreet koverstr...@google.com CC

[PATCH v3 04/26] block: Refactor blk_update_request()

2012-09-24 Thread Kent Overstreet
partial updates, and dumping before and after on various bio/bvec fields when doing a partial update. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- block/blk-core.c | 80 +--- 1 file changed, 12 insertions

[PATCH v3 01/26] block: Fix a buffer overrun in bio_integrity_split()

2012-09-24 Thread Kent Overstreet
in bio_integrity_split() that didn't make any sense. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Martin K. Petersen martin.peter...@oracle.com --- fs/bio-integrity.c | 3 --- include/linux/bio.h | 6 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git

Re: [PATCH v3 07/26] block: Use bio_sectors() more consistently

2012-09-24 Thread Kent Overstreet
On Mon, Sep 24, 2012 at 07:04:50PM -0400, Jim Paris wrote: Kent Overstreet wrote: Bunch of places in the code weren't using it where they could be - this'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet koverstr

Re: [Drbd-dev] [PATCH v3 06/26] block: Add bio_end_sector()

2012-09-25 Thread Kent Overstreet
On Tue, Sep 25, 2012 at 01:54:52PM +0200, Lars Ellenberg wrote: On Mon, Sep 24, 2012 at 03:34:46PM -0700, Kent Overstreet wrote: Just a little convenience macro - main reason to add it now is preparing for immutable bio vecs, it'll reduce the size of the patch that puts bi_sector/bi_size

Re: [dm-devel] [PATCH v3 11/26] block: Add submit_bio_wait(), remove from md

2012-09-25 Thread Kent Overstreet
On Tue, Sep 25, 2012 at 07:51:07AM +0200, Hannes Reinecke wrote: On 09/25/2012 12:34 AM, Kent Overstreet wrote: +/** + * submit_bio_wait - submit a bio, and wait until it completes + * @rw: whether to %READ or %WRITE, or maybe to %READA (read ahead) + * @bio: The struct bio which

Re: [PATCH v3 05/26] md: Convert md_trim_bio() to use bio_advance()

2012-09-26 Thread Kent Overstreet
On Wed, Sep 26, 2012 at 10:38:27AM +1000, NeilBrown wrote: On Mon, 24 Sep 2012 15:34:45 -0700 Kent Overstreet koverstr...@google.com wrote: Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/md.c | 19

Re: [RFC, PATCH] Extensible AIO interface

2012-10-04 Thread Kent Overstreet
On Wed, Oct 03, 2012 at 03:15:26PM -0400, Jeff Moyer wrote: Kent Overstreet koverstr...@google.com writes: On Tue, Oct 02, 2012 at 01:41:17PM -0400, Jeff Moyer wrote: Kent Overstreet koverstr...@google.com writes: So, I and other people keep running into things where we really need

Re: [RFC, PATCH] Extensible AIO interface

2012-10-04 Thread Kent Overstreet
On Thu, Oct 04, 2012 at 06:58:06AM +0900, Tejun Heo wrote: Hello, Kent. On Tue, Oct 02, 2012 at 08:00:20PM -0700, Kent Overstreet wrote: However, I don't think it's a good idea to try to implement something which is a neutral transport of opaque data between userland and lower layers

[PATCH 1/5] aio: Kill return value of aio_complete()

2012-10-09 Thread Kent Overstreet
Nothing used the return value, and it probably wasn't possible to use it safely for the locked versions (aio_complete(), aio_put_req()). Just kill it. Signed-off-by: Kent Overstreet koverstr...@google.com --- fs/aio.c| 19 +++ include/linux/aio.h |8 2

[PATCH 4/5] aio: vmap ringbuffer

2012-10-09 Thread Kent Overstreet
into userspace, but I couldn't figure out how to sanely do that... so vmap works for now. Signed-off-by: Kent Overstreet koverstr...@google.com --- fs/aio.c| 85 +-- include/linux/aio.h |7 +++-- 2 files changed, 32 insertions(+), 60

[PATCH 5/5] aio: Refactor aio_read_evt, use cmxchg(), fix bug

2012-10-09 Thread Kent Overstreet
Bunch of cleanup, and make it lockless so that userspace can safely pull events off the ringbuffer without racing with io_getevents(). Signed-off-by: Kent Overstreet koverstr...@google.com --- fs/aio.c | 220 +- 1 file changed, 73

[PATCH 3/5] aio: Rewrite refcounting

2012-10-09 Thread Kent Overstreet
goes to 1, we drop that initial refcount. Some other semi related cleanup too. Signed-off-by: Kent Overstreet koverstr...@google.com --- fs/aio.c| 187 +-- include/linux/aio.h |5 +- 2 files changed, 63 insertions(+), 129 deletions

[PATCH 2/5] aio: kiocb_cancel()

2012-10-09 Thread Kent Overstreet
Minor refactoring, to get rid of some duplicated code Signed-off-by: Kent Overstreet koverstr...@google.com --- fs/aio.c | 72 ++ 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 1ad2d97

Re: [PATCH 5/5] aio: Refactor aio_read_evt, use cmxchg(), fix bug

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 11:37:53AM -0700, Zach Brown wrote: On Mon, Oct 08, 2012 at 11:39:20PM -0700, Kent Overstreet wrote: Bunch of cleanup Ugh. That's way too much noisy change for one patch with no description. Break it up into functional pieces and actually describe them. Heh, I

Re: [PATCH 4/5] aio: vmap ringbuffer

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 11:29:49AM -0700, Zach Brown wrote: On Mon, Oct 08, 2012 at 11:39:19PM -0700, Kent Overstreet wrote: It simplifies a lot of stuff if the ringbuffer is contiguously mapped into kernel space, and we can delete a lot of code - in particular, this is useful

Re: [PATCH 2/5] aio: kiocb_cancel()

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 11:26:25AM -0700, Zach Brown wrote: On Mon, Oct 08, 2012 at 11:39:17PM -0700, Kent Overstreet wrote: Minor refactoring, to get rid of some duplicated code Honestly: I wouldn't bother. Nothing of consequence uses cancel. I have an RFC patch series that tears it out

Re: [PATCH 3/5] aio: Rewrite refcounting

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 11:27:55AM -0700, Zach Brown wrote: On Mon, Oct 08, 2012 at 11:39:18PM -0700, Kent Overstreet wrote: The refcounting before wasn't very clear; there are two refcounts in struct kioctx, with an unclear relationship between them (or between them and ctx-dead). Now

Re: [PATCH 4/5] aio: vmap ringbuffer

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 03:32:10PM -0700, Zach Brown wrote: If it is measurable I'll take another stab at using memory from __get_free_pages() for the ringbuffer. That really would be the ideal solution. No, then you'll run into high order allocation failures with rings that don't fit in

Re: [PATCH 5/5] aio: Refactor aio_read_evt, use cmxchg(), fix bug

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 03:47:03PM -0700, Zach Brown wrote: If libaio is the only thing in userspace looking at the ringbuffer, and if I'm looking at the latest libaio code this shouldn't break anything... We can't assume that libaio is the only thing in userspace using the mapped buffer

Re: [PATCH 5/5] aio: Refactor aio_read_evt, use cmxchg(), fix bug

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 04:10:59PM -0700, Zach Brown wrote: Well, the ringbuffer does have those compat flags and incompat flags. Which libaio conveniently doesn't check, but for what it does it shouldn't really matter I guess. Well, the presumed point of the incompat flags would be to

Re: [PATCH 4/5] aio: vmap ringbuffer

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 03:58:36PM -0700, Zach Brown wrote: Not if we decouple the ringbuffer size from max_requests. Hmm, interesting. This would be useful to do anyways because right now, allocating a kiocb has to take a global refcount and check head and tail in the ringbuffer just

Re: [PATCH 3/5] aio: Rewrite refcounting

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 03:35:04PM -0700, Zach Brown wrote: Alright... send it out then. Workin' on it! :) Also, do you know which branch Jens has his patches in? http://git.kernel.dk/?p=linux-block.git;a=commit;h=6b6723fc3e4f24dbd80526df935ca115ead578c6

Re: [PATCH 5/5] aio: Refactor aio_read_evt, use cmxchg(), fix bug

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 05:26:34PM -0700, Zach Brown wrote: The AIO ringbuffer stuff just annoys me more than most Not more than everyone, though, I can personally promise you that :). (it wasn't until the other day that I realized it was actually exported to userspace... what led to

Re: [PATCH 4/5] aio: vmap ringbuffer

2012-10-09 Thread Kent Overstreet
On Tue, Oct 09, 2012 at 05:36:26PM -0700, Zach Brown wrote: The only situation you have to worry about is when the ringbuffer fills up and stuff goes on the list, and then completions completely stop - this should be a rare enough situation that maybe we could just hack around it with a

Re: [PATCH 2/5] aio: kiocb_cancel()

2012-10-10 Thread Kent Overstreet
On Wed, Oct 10, 2012 at 07:03:56AM -0400, Theodore Ts'o wrote: On Tue, Oct 09, 2012 at 02:37:00PM -0700, Kent Overstreet wrote: Honestly: I wouldn't bother. Nothing of consequence uses cancel. I have an RFC patch series that tears it out. Let me polish that up send it out, I'll cc

Re: [PATCH 5/5] aio: Refactor aio_read_evt, use cmxchg(), fix bug

2012-10-10 Thread Kent Overstreet
On Wed, Oct 10, 2012 at 02:43:15PM -0700, Zach Brown wrote: True. But that could be solved with a separate interface that either doesn't use a context to submit a call synchronously, or uses an implicit per thread context. Sure, but why bother if we can make the one submission interface

[PATCH v4 00/24] Prep work for immutable bio vecs

2012-10-15 Thread Kent Overstreet
blown up for those - this'll be of use later too, for generic bio splitting. I've got 3 patch series queued up but they all should be independent - git tree is at http://evilpiepirate.org/git/linux-bcache.git for-jens It's on top of jens' for-next branch. Kent Overstreet (24): block: Add

[PATCH v4 02/24] block: Refactor blk_update_request()

2012-10-15 Thread Kent Overstreet
partial updates, and dumping before and after on various bio/bvec fields when doing a partial update. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- block/blk-core.c | 80 +--- 1 file changed, 12 insertions

[PATCH v4 01/24] block: Add bio_advance()

2012-10-15 Thread Kent Overstreet
This is prep work for immutable bio vecs; we first want to centralize where bvecs are modified. Next two patches convert some existing code to use this function. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c | 41

[PATCH v4 10/24] raid10: Use bio_reset()

2012-10-15 Thread Kent Overstreet
More prep work for immutable bio vecs, mainly getting rid of references to bi_idx. bio_reset was being open coded in a few places. The one in sync_request was a bit nontrivial to convert, so could use some extra eyeballs. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax

[PATCH v4 12/24] raid5: use bio_reset()

2012-10-15 Thread Kent Overstreet
Had to shuffle the code around a bit (where bi_rw and bi_end_io were set), but shouldn't really be anything tricky here Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid5.c | 27 +-- 1 file

[PATCH v2 19/26] bounce: Refactor __blk_queue_bounce to not use bi_io_vec

2012-10-15 Thread Kent Overstreet
the bounce code doesn't own that bio the __ version wasn't correct. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- mm/bounce.c | 73 - 1 file changed, 19 insertions(+), 54 deletions(-) diff

[PATCH v2 25/26] bio-integrity: Add explicit field for owner of bip_buf

2012-10-15 Thread Kent Overstreet
This was the only real user of BIO_CLONED, which didn't have very clear semantics. Convert to its own flag so we can get rid of BIO_CLONED. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Martin K. Petersen martin.peter...@oracle.com --- fs/bio

[PATCH v2 24/26] block: Add an explicit bio flag for bios that own their bvec

2012-10-15 Thread Kent Overstreet
This is for the new bio splitting code. When we split a bio, if the split occured on a bvec boundry we reuse the bvec for the new bio. But that means bio_free() can't free it, hence the explicit flag. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk Acked

[PATCH v2 26/26] block: Add BIO_SUBMITTED flag, kill BIO_CLONED

2012-10-15 Thread Kent Overstreet
for the new flag. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- block/blk-core.c | 2 ++ drivers/md/dm.c | 1 - fs/bio-integrity.c| 1 - fs/bio.c | 8 +--- include/linux/blk_types.h | 2 +- 5 files changed, 8

[PATCH v2 23/26] raid1: use bio_alloc_pages()

2012-10-15 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index d30b4cb..18b743a 100644

[PATCH v2 22/26] block: Add bio_alloc_pages()

2012-10-15 Thread Kent Overstreet
More utility code to replace stuff that's getting open coded. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c| 28 include/linux/bio.h | 1 + 2 files changed, 29 insertions(+) diff --git a/fs/bio.c b/fs

[PATCH v2 08/26] block: Remove bi_idx references

2012-10-15 Thread Kent Overstreet
These were harmless but uneccessary,andt getting rid of them makes the code easier to audit since most of them need to be removed. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- drivers/block/floppy.c | 1 - drivers/md/dm-verity.c | 2 +- drivers/md

[PATCH v2 15/26] block: Add bio_copy_data()

2012-10-15 Thread Kent Overstreet
This gets open coded quite a bit and it's tricky to get right, so make a generic version and convert some existing users over to it instead. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c| 70

[PATCH v2 20/26] block: Add bio_for_each_segment_all()

2012-10-15 Thread Kent Overstreet
. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- drivers/md/raid1.c | 2 +- fs/bio.c| 12 ++-- fs/exofs/ore.c | 2 +- fs/exofs/ore_raid.c | 2 +- include/linux/bio.h | 16 +--- mm/bounce.c | 2 +- 6 files

[PATCH v2 21/26] block: Convert some code to bio_for_each_segment_all()

2012-10-15 Thread Kent Overstreet
A few places in the code were either open coding or using the wrong version - fix. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/dm-crypt.c | 3 +-- drivers/md/raid1.c| 10 +++--- fs/bio.c

[PATCH v2 18/26] raid1: use bio_copy_data()

2012-10-15 Thread Kent Overstreet
This doesn't really delete any code _yet_, but once immutable bvecs are done we can just delete the rest of the code in that loop. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 5 ++--- 1 file changed, 2

[PATCH v2 17/26] pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage

2012-10-15 Thread Kent Overstreet
In the short term this'll help with code auditing, and if this code ever gets used now it's converted :) Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jiri Kosina jkos...@suse.cz --- drivers/block/pktcdvd.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff

[PATCH v2 10/26] block: Add submit_bio_wait(), remove from md

2012-10-15 Thread Kent Overstreet
Random cleanup - this code was duplicated and it's not really specific to md. Also added the ability to return the actual error code. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 19

[PATCH v2 09/26] block: Remove some unnecessary bi_vcnt usage

2012-10-15 Thread Kent Overstreet
More prep work for immutable bvecs/effecient bio splitting - usage of bi_vcnt has to be auditing, so getting rid of all the unnecessary usage makes that easier. Plus, bio_segments() is really what this code wanted, as it respects the current value of bi_idx. Signed-off-by: Kent Overstreet

[PATCH v2 16/26] pktcdvd: use bio_copy_data()

2012-10-15 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Jiri Kosina jkos...@suse.cz --- drivers/block/pktcdvd.c | 79 - 1 file changed, 12 insertions(+), 67 deletions(-) diff --git a/drivers/block/pktcdvd.c b

[PATCH v2 14/26] raid1: Refactor narrow_write_error() to not use bi_idx

2012-10-15 Thread Kent Overstreet
More bi_idx removal. This code was just open coding bio_clone(). This could probably be further improved by using bio_advance() instead of skipping over null pages, but that'd be a larger rework. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne

[PATCH v2 13/26] raid5: use bio_reset()

2012-10-15 Thread Kent Overstreet
Had to shuffle the code around a bit (where bi_rw and bi_end_io were set), but shouldn't really be anything tricky here Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid5.c | 28 ++-- 1

[PATCH v2 12/26] raid1: use bio_reset()

2012-10-15 Thread Kent Overstreet
I couldn't figure out what sbio-bi_end_io in process_checks() was supposed to be, so I took the easy way out. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 22 +- 1 file changed, 5

[PATCH v2 11/26] raid10: Use bio_reset()

2012-10-15 Thread Kent Overstreet
More prep work for immutable bio vecs, mainly getting rid of references to bi_idx. bio_reset was being open coded in a few places. The one in sync_request was a bit nontrivial to convert, so could use some extra eyeballs. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax

[PATCH v2 04/26] md: Convert md_trim_bio() to use bio_advance()

2012-10-15 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/md.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 7a2b079..51ce48c 100644

[PATCH v2 07/26] block: Don't use bi_idx in bio_split() or require it to be 0

2012-10-15 Thread Kent Overstreet
Prep work for immutable bio_vecs/efficient bio splitting: they require auditing and removing most uses of bi_idx. So here we convert bio_split() to respect the current value of bi_idx and use the bio_iovec() macro, instead of assuming bi_idx will be 0. Signed-off-by: Kent Overstreet koverstr

[PATCH v4 20/24] block: Convert some code to bio_for_each_segment_all()

2012-10-15 Thread Kent Overstreet
pass in a struct bio_vec (not a pointer) which is updated with what the current biovec would be (taking into account bi_bvec_done and bi_size). So because of that it's more worthwhile to be consistent about bio_for_each_segment()/bio_for_each_segment_all() usage. Signed-off-by: Kent Overstreet

[PATCH v4 21/24] block: Add bio_alloc_pages()

2012-10-15 Thread Kent Overstreet
More utility code to replace stuff that's getting open coded. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 16 +++- fs/bio.c| 28 include/linux/bio.h

[PATCH v4 1/2] block: Reorder struct bio_set

2012-10-15 Thread Kent Overstreet
This is prep work for the next patch, which embeds a struct bio_list in struct bio_set. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- include/linux/bio.h | 66 ++--- 1 file changed, 33 insertions(+), 33

[PATCH v4 2/2] block: Convert integrity to bvec_alloc_bs()

2012-10-15 Thread Kent Overstreet
-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Martin K. Petersen martin.peter...@oracle.com --- fs/bio-integrity.c | 132 +++- fs/bio.c| 36 ++ include/linux/bio.h | 8 ++-- 3 files changed, 68

[PATCH v2 06/26] block: Use bio_sectors() more consistently

2012-10-15 Thread Kent Overstreet
Bunch of places in the code weren't using it where they could be - this'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- drivers/block/aoe/aoeblk.c | 2

[PATCH v2 03/26] block: Refactor blk_update_request()

2012-10-15 Thread Kent Overstreet
Converts it to use bio_advance(), simplifying it quite a bit in the process. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- block/blk-core.c | 84 +++- 1 file changed, 16 insertions(+), 68 deletions

[PATCH v2 05/26] block: Add bio_end()

2012-10-15 Thread Kent Overstreet
Just a little convenience macro - main reason to add it now is preparing for immutable bio vecs, it'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- block/blk

[PATCH v2 02/26] block: Add bio_advance()

2012-10-15 Thread Kent Overstreet
This is prep work for immutable bio vecs; we first want to centralize where bvecs are modified. Next two patches convert some existing code to use this function. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c| 41

[PATCH v2 01/26] block: Convert integrity to bvec_alloc_bs(), and a bugfix

2012-10-15 Thread Kent Overstreet
for the pointer. Less code is always nice too, though. Also fix an amusing bug in bio_integrity_split() - struct bio_pair doesn't have the integrity bvecs after the bio_integrity_payloads, so there was a buffer overrun. The code was confusing pointers with arrays. Signed-off-by: Kent Overstreet koverstr

[PATCH v2 00/26] Prep work for immutable bio vecs

2012-10-15 Thread Kent Overstreet
, bi_idx and bi_bvec_done may both be nonzero. Again, just need to use generic accessors. v2: Patch series now has all the prep work to be done before abstracting out the bio iterator, I think. Kent Overstreet (26): block: Convert integrity to bvec_alloc_bs(), and a bugfix block: Add bio_advance

[PATCH v4 1/2] block: Fix a buffer overrun in bio_integrity_split()

2012-10-15 Thread Kent Overstreet
vecs - a later patch is going to make more use of this pointer. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Martin K. Petersen martin.peter...@oracle.com --- fs/bio-integrity.c | 5 +++-- include/linux/bio.h | 4 +++- 2 files changed, 6 insertions(+), 3

[PATCH v4 2/2] block: Avoid deadlocks with bio allocation by stacking drivers

2012-10-15 Thread Kent Overstreet
-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk Acked-by: Tejun Heo t...@kernel.org Reviewed-by: Muthukumar Ratty mut...@gmail.com --- fs/bio.c| 116 +++- include/linux/bio.h | 9 2 files changed, 123

[PATCH v4 24/24] block: Add BIO_SUBMITTED flag, kill BIO_CLONED

2012-10-15 Thread Kent Overstreet
for the new flag. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Alasdair Kergon a...@redhat.com CC: dm-de...@redhat.com CC: Martin K. Petersen martin.peter...@oracle.com --- block/blk-core.c | 2 ++ drivers/md/dm.c | 1 - fs/bio

[PATCH v4 23/24] bio-integrity: Add explicit field for owner of bip_buf

2012-10-15 Thread Kent Overstreet
This was the only real user of BIO_CLONED, which didn't have very clear semantics. Convert to its own flag so we can get rid of BIO_CLONED. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Martin K. Petersen martin.peter...@oracle.com --- fs/bio

[PATCH v4 22/24] block: Add an explicit bio flag for bios that own their bvec

2012-10-15 Thread Kent Overstreet
This is for the new bio splitting code. When we split a bio, if the split occured on a bvec boundry we reuse the bvec for the new bio. But that means bio_free() can't free it, hence the explicit flag. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk Acked

[PATCH v4 15/24] pktcdvd: use bio_copy_data()

2012-10-15 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Jiri Kosina jkos...@suse.cz --- drivers/block/pktcdvd.c | 79 - 1 file changed, 12 insertions(+), 67 deletions(-) diff --git a/drivers/block/pktcdvd.c b

[PATCH v4 19/24] block: Add bio_for_each_segment_all()

2012-10-15 Thread Kent Overstreet
implementation. This will also help document the intent of code that's using it - bio_for_each_segment_all() is only legal to use for code that owns the bio. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Neil Brown ne...@suse.de CC: Boaz Harrosh bharr

[PATCH v4 07/24] block: Remove bi_idx references

2012-10-15 Thread Kent Overstreet
For immutable bvecs, all bi_idx usage needs to be audited - so here we're removing all the unnecessary uses. Most of these are places where it was being initialized on a bio that was just allocated, a few others are conversions to standard macros. Signed-off-by: Kent Overstreet koverstr

[PATCH v4 18/24] bounce: Refactor __blk_queue_bounce to not use bi_io_vec

2012-10-15 Thread Kent Overstreet
- a later patch renames __bio_for_each_segment() - bio_for_each_segment_all(), and documents that bio_for_each_segment_all() is only for code that owns the bio. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- mm/bounce.c | 73

[PATCH v4 17/24] raid1: use bio_copy_data()

2012-10-15 Thread Kent Overstreet
This doesn't really delete any code _yet_, but once immutable bvecs are done we can just delete the rest of the code in that loop. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 5 ++--- 1 file changed, 2

[PATCH v4 16/24] pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage

2012-10-15 Thread Kent Overstreet
In the short term this'll help with code auditing, and if this code ever gets used now it's converted :) Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jiri Kosina jkos...@suse.cz --- drivers/block/pktcdvd.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff

[PATCH v4 14/24] block: Add bio_copy_data()

2012-10-15 Thread Kent Overstreet
This gets open coded quite a bit and it's tricky to get right, so make a generic version and convert some existing users over to it instead. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c| 70

  1   2   3   4   5   6   7   8   9   10   >