<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/block/brd.c, branch v3.0.51</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/block/brd.c?h=v3.0.51</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/block/brd.c?h=v3.0.51'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-05-26T19:06:50Z</updated>
<entry>
<title>brd: export module parameters</title>
<updated>2011-05-26T19:06:50Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2011-05-26T19:06:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8892cbaf686fb18a5f0558b9fd7773b32c0c7852'/>
<id>urn:sha1:8892cbaf686fb18a5f0558b9fd7773b32c0c7852</id>
<content type='text'>
Export 'rd_nr', 'rd_size' and 'max_part' parameters to sysfs so user can
know that how many devices are allowed, how big each device is and how
many partitions are supported. If 'max_part' is 0, it means simply the
device doesn't support partitioning.

Also note that 'max_part' can be adjusted to power of 2 minus 1 form if
needed. User should check this value after the module loading if he/she
want to use that number correctly (i.e. fdisk, mknod, etc.).

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Laurent Vivier &lt;Laurent.Vivier@bull.net&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>brd: fix comment on initial device creation</title>
<updated>2011-05-26T19:06:50Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2011-05-26T19:06:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=13868b76ab8135389fe1d8cf1c6a4847c9fef0a7'/>
<id>urn:sha1:13868b76ab8135389fe1d8cf1c6a4847c9fef0a7</id>
<content type='text'>
If 'rd_nr' param was not specified, 16 (can be adjusted via
CONFIG_BLK_DEV_RAM_COUNT) devices would be created by default
but comment said 1. Fix it.

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>brd: handle on-demand devices correctly</title>
<updated>2011-05-26T19:06:50Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2011-05-26T19:06:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=af46566885a373b0a526932484cd8fef8de7b598'/>
<id>urn:sha1:af46566885a373b0a526932484cd8fef8de7b598</id>
<content type='text'>
When finding or allocating a ram disk device, brd_probe() did not take
partition numbers into account so that it can result to a different
device. Consider following example (I set CONFIG_BLK_DEV_RAM_COUNT=4
for simplicity) :

$ sudo modprobe brd max_part=15
$ ls -l /dev/ram*
brw-rw---- 1 root disk 1,  0 2011-05-25 15:41 /dev/ram0
brw-rw---- 1 root disk 1, 16 2011-05-25 15:41 /dev/ram1
brw-rw---- 1 root disk 1, 32 2011-05-25 15:41 /dev/ram2
brw-rw---- 1 root disk 1, 48 2011-05-25 15:41 /dev/ram3
$ sudo mknod /dev/ram4 b 1 64
$ sudo dd if=/dev/zero of=/dev/ram4 bs=4k count=256
256+0 records in
256+0 records out
1048576 bytes (1.0 MB) copied, 0.00215578 s, 486 MB/s
namhyung@leonhard:linux$ ls -l /dev/ram*
brw-rw---- 1 root disk 1,    0 2011-05-25 15:41 /dev/ram0
brw-rw---- 1 root disk 1,   16 2011-05-25 15:41 /dev/ram1
brw-rw---- 1 root disk 1,   32 2011-05-25 15:41 /dev/ram2
brw-rw---- 1 root disk 1,   48 2011-05-25 15:41 /dev/ram3
brw-r--r-- 1 root root 1,   64 2011-05-25 15:45 /dev/ram4
brw-rw---- 1 root disk 1, 1024 2011-05-25 15:44 /dev/ram64

After this patch, /dev/ram4 - instead of /dev/ram64 - was
accessed correctly.

In addition, 'range' passed to blk_register_region() should
include all range of dev_t that RAMDISK_MAJOR can address.
It does not need to be limited by partition numbers unless
'rd_nr' param was specified.

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Laurent Vivier &lt;Laurent.Vivier@bull.net&gt;
Cc: stable@kernel.org
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>brd: limit 'max_part' module param to DISK_MAX_PARTS</title>
<updated>2011-05-26T19:06:50Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2011-05-26T19:06:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=315980c8688c4b06713c1a5fe9d64cdf8ab57a72'/>
<id>urn:sha1:315980c8688c4b06713c1a5fe9d64cdf8ab57a72</id>
<content type='text'>
The 'max_part' parameter controls the number of maximum partition
a brd device can have. However if a user specifies very large
value it would exceed the limitation of device minor number and
can cause a kernel panic (or, at least, produce invalid device
nodes in some cases).

On my desktop system, following command kills the kernel. On qemu,
it triggers similar oops but the kernel was alive:

$ sudo modprobe brd max_part=100000
 BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
 IP: [&lt;ffffffff81110a9a&gt;] sysfs_create_dir+0x2d/0xae
 PGD 7af1067 PUD 7b19067 PMD 0
 Oops: 0000 [#1] SMP
 last sysfs file:
 CPU 0
 Modules linked in: brd(+)

 Pid: 44, comm: insmod Tainted: G        W   2.6.39-qemu+ #158 Bochs Bochs
 RIP: 0010:[&lt;ffffffff81110a9a&gt;]  [&lt;ffffffff81110a9a&gt;] sysfs_create_dir+0x2d/0xae
 RSP: 0018:ffff880007b15d78  EFLAGS: 00000286
 RAX: ffff880007b05478 RBX: ffff880007a52760 RCX: ffff880007b15dc8
 RDX: ffff880007a4f900 RSI: ffff880007b15e48 RDI: ffff880007a52760
 RBP: ffff880007b15da8 R08: 0000000000000002 R09: 0000000000000000
 R10: ffff880007b15e48 R11: ffff880007b05478 R12: 0000000000000000
 R13: ffff880007b05478 R14: 0000000000400920 R15: 0000000000000063
 FS:  0000000002160880(0063) GS:ffff880007c00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000058 CR3: 0000000007b1c000 CR4: 00000000000006b0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 0000000000000000 DR7: 0000000000000000
 Process insmod (pid: 44, threadinfo ffff880007b14000, task ffff880007acb980)
 Stack:
  ffff880007b15dc8 ffff880007b05478 ffff880007b15da8 00000000fffffffe
  ffff880007a52760 ffff880007b05478 ffff880007b15de8 ffffffff81143c0a
  0000000000400920 ffff880007a52760 ffff880007b05478 0000000000000000
 Call Trace:
  [&lt;ffffffff81143c0a&gt;] kobject_add_internal+0xdf/0x1a0
  [&lt;ffffffff81143da1&gt;] kobject_add_varg+0x41/0x50
  [&lt;ffffffff81143e6b&gt;] kobject_add+0x64/0x66
  [&lt;ffffffff8113bbe7&gt;] blk_register_queue+0x5f/0xb8
  [&lt;ffffffff81140f72&gt;] add_disk+0xdf/0x289
  [&lt;ffffffffa00040df&gt;] brd_init+0xdf/0x1aa [brd]
  [&lt;ffffffffa0004000&gt;] ? 0xffffffffa0003fff
  [&lt;ffffffffa0004000&gt;] ? 0xffffffffa0003fff
  [&lt;ffffffff8100020a&gt;] do_one_initcall+0x7a/0x12e
  [&lt;ffffffff8108516c&gt;] sys_init_module+0x9c/0x1dc
  [&lt;ffffffff812ff4bb&gt;] system_call_fastpath+0x16/0x1b
 Code: 89 e5 41 55 41 54 53 48 89 fb 48 83 ec 18 48 85 ff 75 04 0f 0b eb fe 48 8b 47 18 49 c7 c4 70 1e 4d 81 48 85 c0 74 04 4c 8b 60 30
  8b 44 24 58 45 31 ed 0f b6 c4 85 c0 74 0d 48 8b 43 28 48 89
 RIP  [&lt;ffffffff81110a9a&gt;] sysfs_create_dir+0x2d/0xae
  RSP &lt;ffff880007b15d78&gt;
 CR2: 0000000000000058
 ---[ end trace aebb1175ce1f6739 ]---

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Laurent Vivier &lt;Laurent.Vivier@bull.net&gt;
Cc: stable@kernel.org
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>brd: get rid of unused members from struct brd_device</title>
<updated>2011-05-26T19:06:50Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2011-05-26T19:06:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a2cba2913c7623789296e39d787b01031f9c7969'/>
<id>urn:sha1:a2cba2913c7623789296e39d787b01031f9c7969</id>
<content type='text'>
brd_refcnt, brd_offset, brd_sizelimit and brd_blocksize in struct
brd_device seem to be copied from struct loop_device but they're
not used anywhere. Let get rid of them.

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-2.6.37/barrier' of git://git.kernel.dk/linux-2.6-block</title>
<updated>2010-10-23T00:07:18Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-10-23T00:07:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a2887097f25cd38cadfc11d10769e2b349fb5eca'/>
<id>urn:sha1:a2887097f25cd38cadfc11d10769e2b349fb5eca</id>
<content type='text'>
* 'for-2.6.37/barrier' of git://git.kernel.dk/linux-2.6-block: (46 commits)
  xen-blkfront: disable barrier/flush write support
  Added blk-lib.c and blk-barrier.c was renamed to blk-flush.c
  block: remove BLKDEV_IFL_WAIT
  aic7xxx_old: removed unused 'req' variable
  block: remove the BH_Eopnotsupp flag
  block: remove the BLKDEV_IFL_BARRIER flag
  block: remove the WRITE_BARRIER flag
  swap: do not send discards as barriers
  fat: do not send discards as barriers
  ext4: do not send discards as barriers
  jbd2: replace barriers with explicit flush / FUA usage
  jbd2: Modify ASYNC_COMMIT code to not rely on queue draining on barrier
  jbd: replace barriers with explicit flush / FUA usage
  nilfs2: replace barriers with explicit flush / FUA usage
  reiserfs: replace barriers with explicit flush / FUA usage
  gfs2: replace barriers with explicit flush / FUA usage
  btrfs: replace barriers with explicit flush / FUA usage
  xfs: replace barriers with explicit flush / FUA usage
  block: pass gfp_mask and flags to sb_issue_discard
  dm: convey that all flushes are processed as empty
  ...
</content>
</entry>
<entry>
<title>block: autoconvert trivial BKL users to private mutex</title>
<updated>2010-10-05T13:01:10Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2010-06-02T12:28:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2a48fc0ab24241755dc93bfd4f01d68efab47f5a'/>
<id>urn:sha1:2a48fc0ab24241755dc93bfd4f01d68efab47f5a</id>
<content type='text'>
The block device drivers have all gained new lock_kernel
calls from a recent pushdown, and some of the drivers
were already using the BKL before.

This turns the BKL into a set of per-driver mutexes.
Still need to check whether this is safe to do.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*&lt;linux\/smp_lock.h&gt;/d' ${file}
    else
            sed -i 's/include.*&lt;linux\/smp_lock.h&gt;.*$/include &lt;linux\/mutex.h&gt;/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\&gt;[ ]*()/mutex_\1lock(\&amp;${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\&lt;smp_lock.h\&gt;/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>block: deprecate barrier and replace blk_queue_ordered() with blk_queue_flush()</title>
<updated>2010-09-10T10:35:36Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-09-03T09:56:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4913efe456c987057e5d36a3f0a55422a9072cae'/>
<id>urn:sha1:4913efe456c987057e5d36a3f0a55422a9072cae</id>
<content type='text'>
Barrier is deemed too heavy and will soon be replaced by FLUSH/FUA
requests.  Deprecate barrier.  All REQ_HARDBARRIERs are failed with
-EOPNOTSUPP and blk_queue_ordered() is replaced with simpler
blk_queue_flush().

blk_queue_flush() takes combinations of REQ_FLUSH and FUA.  If a
device has write cache and can flush it, it should set REQ_FLUSH.  If
the device can handle FUA writes, it should also set REQ_FUA.

All blk_queue_ordered() users are converted.

* ORDERED_DRAIN is mapped to 0 which is the default value.
* ORDERED_DRAIN_FLUSH is mapped to REQ_FLUSH.
* ORDERED_DRAIN_FLUSH_FUA is mapped to REQ_FLUSH | REQ_FUA.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Boaz Harrosh &lt;bharrosh@panasas.com&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Nick Piggin &lt;npiggin@kernel.dk&gt;
Cc: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Cc: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: Chris Wright &lt;chrisw@sous-sol.org&gt;
Cc: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: Geert Uytterhoeven &lt;Geert.Uytterhoeven@sonycom.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Alasdair G Kergon &lt;agk@redhat.com&gt;
Cc: Pierre Ossman &lt;drzeus@drzeus.cx&gt;
Cc: Stefan Weinhuber &lt;wein@de.ibm.com&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: kill QUEUE_ORDERED_BY_TAG</title>
<updated>2010-09-10T10:35:36Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-09-03T09:56:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6958f145459ca7ad9715024de97445addacb8510'/>
<id>urn:sha1:6958f145459ca7ad9715024de97445addacb8510</id>
<content type='text'>
Nobody is making meaningful use of ORDERED_BY_TAG now and queue
draining for barrier requests will be removed soon which will render
the advantage of tag ordering moot.  Kill ORDERED_BY_TAG.  The
following users are affected.

* brd: converted to ORDERED_DRAIN.
* virtio_blk: ORDERED_TAG path was already marked deprecated.  Removed.
* xen-blkfront: ORDERED_TAG case dropped.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Nick Piggin &lt;npiggin@kernel.dk&gt;
Cc: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Cc: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: Chris Wright &lt;chrisw@sous-sol.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: push down BKL into .locked_ioctl</title>
<updated>2010-08-07T16:25:00Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2010-07-08T08:18:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8a6cfeb6deca3a8fefd639d898b0d163c0b5d368'/>
<id>urn:sha1:8a6cfeb6deca3a8fefd639d898b0d163c0b5d368</id>
<content type='text'>
As a preparation for the removal of the big kernel
lock in the block layer, this removes the BKL
from the common ioctl handling code, moving it
into every single driver still using it.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
</feed>
