Commit 1ce48904 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'block-2.6.24' of git://git.kernel.dk/data/git/linux-2.6-block

* 'block-2.6.24' of git://git.kernel.dk/data/git/linux-2.6-block: (37 commits)
  [BLOCK] Fix failing compile with BLK_DEV_IO_TRACE=n
  compat_ioctl: move floppy handlers to block/compat_ioctl.c
  compat_ioctl: move cdrom handlers to block/compat_ioctl.c
  compat_ioctl: move BLKPG handling to block/compat_ioctl.c
  compat_ioctl: move hdio calls to block/compat_ioctl.c
  compat_ioctl: handle blk_trace ioctls
  compat_ioctl: add compat_blkdev_driver_ioctl()
  compat_ioctl: move common block ioctls to compat_blkdev_ioctl
  Sysace: Don't enable IRQ until after interrupt handler is registered
  Sysace: sparse fixes
  Sysace: Minor coding convention fixup
  drivers/block/umem: use DRIVER_NAME where appropriate
  drivers/block/umem: trim trailing whitespace
  drivers/block/umem: minor cleanups
  drivers/block/umem: use dev_printk()
  drivers/block/umem: move private include away from include/linux
  Sysace: Labels in C code should not be indented.
  Sysace: Add of_platform_bus binding
  Sysace: Move IRQ handler registration to occur after FSM is initialized
  Sysace: minor rework and cleanup changes
  ...
parents 55982fd1 780513ec
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -477,9 +477,9 @@ With this multipage bio design:
  the same bi_io_vec array, but with the index and size accordingly modified)
- A linked list of bios is used as before for unrelated merges (*) - this
  avoids reallocs and makes independent completions easier to handle.
- Code that traverses the req list needs to make a distinction between
  segments of a request (bio_for_each_segment) and the distinct completion
  units/bios (rq_for_each_bio).
- Code that traverses the req list can find all the segments of a bio
  by using rq_for_each_segment.  This handles the fact that a request
  has multiple bios, each of which can have multiple segments.
- Drivers which can't process a large bio in one shot can use the bi_idx
  field to keep track of the next bio_vec entry to process.
  (e.g a 1MB bio_vec needs to be handled in max 128kB chunks for IDE)
@@ -664,13 +664,13 @@ in lvm or md.

3.2.1 Traversing segments and completion units in a request

The macros bio_for_each_segment() and rq_for_each_bio() should be used for
traversing the bios in the request list (drivers should avoid directly
trying to do it themselves). Using these helpers should also make it easier
to cope with block changes in the future.
The macro rq_for_each_segment() should be used for traversing the bios
in the request list (drivers should avoid directly trying to do it
themselves). Using these helpers should also make it easier to cope
with block changes in the future.

	rq_for_each_bio(bio, rq)
		bio_for_each_segment(bio_vec, bio, i)
	struct req_iterator iter;
	rq_for_each_segment(bio_vec, rq, iter)
		/* bio_vec is now current segment */

I/O completion callbacks are per-bio rather than per-segment, so drivers
+9 −2
Original line number Diff line number Diff line
@@ -86,8 +86,15 @@ extern int sys_ioprio_get(int, int);
#error "Unsupported arch"
#endif

_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
_syscall2(int, ioprio_get, int, which, int, who);
static inline int ioprio_set(int which, int who, int ioprio)
{
	return syscall(__NR_ioprio_set, which, who, ioprio);
}

static inline int ioprio_get(int which, int who)
{
	return syscall(__NR_ioprio_get, which, who);
}

enum {
	IOPRIO_CLASS_NONE,
+7 −0
Original line number Diff line number Diff line
@@ -4156,6 +4156,13 @@ W: http://oss.sgi.com/projects/xfs
T:	git git://oss.sgi.com:8090/xfs/xfs-2.6.git
S:	Supported

XILINX SYSTEMACE DRIVER
P:	Grant Likely
M:	grant.likely@secretlab.ca
W:	http://www.secretlab.ca/
L:	linux-kernel@vger.kernel.org
S:	Maintained

XILINX UARTLITE SERIAL DRIVER
P:	Peter Korsgaard
M:	jacmet@sunsite.dk
+1 −0
Original line number Diff line number Diff line
@@ -11,3 +11,4 @@ obj-$(CONFIG_IOSCHED_DEADLINE) += deadline-iosched.o
obj-$(CONFIG_IOSCHED_CFQ)	+= cfq-iosched.o

obj-$(CONFIG_BLK_DEV_IO_TRACE)	+= blktrace.o
obj-$(CONFIG_COMPAT)		+= compat_ioctl.o
+34 −20
Original line number Diff line number Diff line
@@ -312,33 +312,26 @@ static struct rchan_callbacks blk_relay_callbacks = {
/*
 * Setup everything required to start tracing
 */
static int blk_trace_setup(struct request_queue *q, struct block_device *bdev,
			   char __user *arg)
int do_blk_trace_setup(struct request_queue *q, struct block_device *bdev,
			struct blk_user_trace_setup *buts)
{
	struct blk_user_trace_setup buts;
	struct blk_trace *old_bt, *bt = NULL;
	struct dentry *dir = NULL;
	char b[BDEVNAME_SIZE];
	int ret, i;

	if (copy_from_user(&buts, arg, sizeof(buts)))
		return -EFAULT;

	if (!buts.buf_size || !buts.buf_nr)
	if (!buts->buf_size || !buts->buf_nr)
		return -EINVAL;

	strcpy(buts.name, bdevname(bdev, b));
	strcpy(buts->name, bdevname(bdev, b));

	/*
	 * some device names have larger paths - convert the slashes
	 * to underscores for this to work as expected
	 */
	for (i = 0; i < strlen(buts.name); i++)
		if (buts.name[i] == '/')
			buts.name[i] = '_';

	if (copy_to_user(arg, &buts, sizeof(buts)))
		return -EFAULT;
	for (i = 0; i < strlen(buts->name); i++)
		if (buts->name[i] == '/')
			buts->name[i] = '_';

	ret = -ENOMEM;
	bt = kzalloc(sizeof(*bt), GFP_KERNEL);
@@ -350,7 +343,7 @@ static int blk_trace_setup(struct request_queue *q, struct block_device *bdev,
		goto err;

	ret = -ENOENT;
	dir = blk_create_tree(buts.name);
	dir = blk_create_tree(buts->name);
	if (!dir)
		goto err;

@@ -363,20 +356,21 @@ static int blk_trace_setup(struct request_queue *q, struct block_device *bdev,
	if (!bt->dropped_file)
		goto err;

	bt->rchan = relay_open("trace", dir, buts.buf_size, buts.buf_nr, &blk_relay_callbacks, bt);
	bt->rchan = relay_open("trace", dir, buts->buf_size,
				buts->buf_nr, &blk_relay_callbacks, bt);
	if (!bt->rchan)
		goto err;

	bt->act_mask = buts.act_mask;
	bt->act_mask = buts->act_mask;
	if (!bt->act_mask)
		bt->act_mask = (u16) -1;

	bt->start_lba = buts.start_lba;
	bt->end_lba = buts.end_lba;
	bt->start_lba = buts->start_lba;
	bt->end_lba = buts->end_lba;
	if (!bt->end_lba)
		bt->end_lba = -1ULL;

	bt->pid = buts.pid;
	bt->pid = buts->pid;
	bt->trace_state = Blktrace_setup;

	ret = -EBUSY;
@@ -401,6 +395,26 @@ err:
	return ret;
}

static int blk_trace_setup(struct request_queue *q, struct block_device *bdev,
			   char __user *arg)
{
	struct blk_user_trace_setup buts;
	int ret;

	ret = copy_from_user(&buts, arg, sizeof(buts));
	if (ret)
		return -EFAULT;

	ret = do_blk_trace_setup(q, bdev, &buts);
	if (ret)
		return ret;

	if (copy_to_user(arg, &buts, sizeof(buts)))
		return -EFAULT;

	return 0;
}

static int blk_trace_startstop(struct request_queue *q, int start)
{
	struct blk_trace *bt;
Loading