noop-iosched: perform full merging

Make noop perform full back- and front-merging and proper coalescing.
Also changes dispatching to back-insertion (rather than sorted) onto
the dispatch queue.

Signed-off-by: Aaron Carroll <aaronc@gelato.unsw.edu.au>
Forward porting some NoOp changes
Adjust add_rq_rb in no-op+v(r) for 3.1 merges
 loop: remove the incorrect write_begin/write_end shortcut

Currently the loop device tries to call directly into write_begin/write_end
instead of going through ->write if it can.  This is a fairly nasty shortcut
as write_begin and write_end are only callbacks for the generic write code
and expect to be called with filesystem specific locks held.

This code currently causes various issues for clustered filesystems as it
doesn't take the required cluster locks, and it also causes issues for XFS
as it doesn't properly lock against the swapext ioctl as called by the
defragmentation tools.  This in case causes data corruption if
defragmentation hits a busy loop device in the wrong time window, as
reported by RH QA.

The reason why we have this shortcut is that it saves a data copy when
doing a transformation on the loop device, which is the technical term
for using cryptoloop (or an XOR transformation).  Given that cryptoloop
has been deprecated in favour of dm-crypt my opinion is that we should
simply drop this shortcut instead of finding complicated ways to to
introduce a formal interface for this shortcut.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fixed noop-iosched
Merge remote branch 'halaszk/master-3.0.31' into master-3.0.31