11 Dec, 2008
1 commit
-
The pktcdvd created class devices only export some sysfs files,
but have no char dev_t registered in the driver.At class device creation time they copy the dev_t value of the
block device to the char device, wich will register a new char
device in the driver core and userspace, with a conflicting dev_t
value.In many cases the class devices dev_t just points to a random
USB device. This fixes the sysfs "duplicate entry" errors.Signed-off-by: Kay Sievers
Acked-by: Peter Osterlund
Cc: Al Viro
Signed-off-by: Linus Torvalds
04 Dec, 2008
1 commit
-
final close of ->bdev should match the initial open, i.e.
get FMODE_READ | FMODE_NDELAY; FMODE_READ|FMODE_WRITE has
been a braino.Signed-off-by: Al Viro
21 Oct, 2008
7 commits
-
* get rid of fake struct file/struct dentry in __blkdev_get()
* merge __blkdev_get() and do_open()
* get rid of flags argument of blkdev_get()Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
To keep the size of changesets sane we split the switch by drivers;
to keep the damn thing bisectable we do the following:
1) rename the affected methods, add ones with correct
prototypes, make (few) callers handle both. That's this changeset.
2) for each driver convert to new methods. *ALL* drivers
are converted in this series.
3) kill the old (renamed) methods.Note that it _is_ a flagday; all in-tree drivers are converted and by the
end of this series no trace of old methods remain. The only reason why
we do that this way is to keep the damn thing bisectable and allow per-driver
debugging if anything goes wrong.New methods:
open(bdev, mode)
release(disk, mode)
ioctl(bdev, mode, cmd, arg) /* Called without BKL */
compat_ioctl(bdev, mode, cmd, arg)
locked_ioctl(bdev, mode, cmd, arg) /* Called with BKL, legacy */Signed-off-by: Al Viro
-
Analog of blkdev_driver_ioctl() with sane arguments. For
now uses fake struct file, by the end of the series it won't
and blkdev_driver_ioctl() will become a wrapper around it.Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
17 Oct, 2008
1 commit
-
Now that device_create() has been audited, rename things back to the
original call to be sane.Signed-off-by: Greg Kroah-Hartman
09 Oct, 2008
2 commits
-
Since all bio_split calls refer the same single bio_split_pool, the bio_split
function can use bio_split_pool directly instead of the mempool_t parameter;then the mempool_t parameter can be removed from bio_split param list, and
bio_split_pool is only referred in fs/bio.c file, can be marked static.Signed-off-by: Denis ChengRq
Signed-off-by: Jens Axboe -
* Implement disk_devt() and part_devt() and use them to directly
access devt instead of computing it from ->major and ->first_minor.Note that all references to ->major and ->first_minor outside of
block layer is used to determine devt of the disk (the part0) and as
->major and ->first_minor will continue to represent devt for the
disk, converting these users aren't strictly necessary. However,
convert them for consistency.* Implement disk_max_parts() to avoid directly deferencing
genhd->minors.* Update bdget_disk() such that it doesn't assume consecutive minor
space.* Move devt computation from register_disk() to add_disk() and make it
the only one (all other usages use the initially determined value).These changes clean up the code and will help disk->part dereference
fix and extended block device numbers.Signed-off-by: Tejun Heo
Signed-off-by: Jens Axboe
28 Aug, 2008
1 commit
-
This reverts commit 5b6155ee70e9c4d2ad7e6f514c8eee06e2711c3a, because
the block device ioctl's really aren't ready for it.In particular, the "struct file *" and the "struct inode *" arguments do
not necessarily match, which means that the unlocked version of the
ioctl (that only gets a "struct file *") isn't actually able to handle
the cases it needs to handle.This fixes bugzilla
http://bugzilla.kernel.org/show_bug.cgi?id=11401
Reported-and-bisected-by: Laurent Riffard
Acked-by: Peter Osterlund
Cc: Alan Cox
Cc: Andrew Morton
Cc: Jens Axboe
Signed-off-by: Linus Torvalds
22 Jul, 2008
1 commit
-
device_create() is race-prone, so use the race-free
device_create_drvdata() instead as device_create() is going away.Signed-off-by: Greg Kroah-Hartman
04 Jul, 2008
2 commits
-
Avoid the 'memset(...,0, ...)' before calling 'init_cdrom_command' because
this function already does it.Signed-off-by: Christophe Jaillet
Acked-by: Peter Osterlund
Signed-off-by: Andrew Morton
Signed-off-by: Jens Axboe -
Push the lock_kernel down into the driver and switch to unlocked_ioctl
[akpm@linux-foundation.org: build fix]
Signed-off-by: Alan Cox
Acked-by: Peter Osterlund
Signed-off-by: Andrew Morton
Signed-off-by: Jens Axboe
03 Jul, 2008
1 commit
-
When devices are stacked, one device's merge_bvec_fn may need to perform
the mapping and then call one or more functions for its underlying devices.The following bio fields are used:
bio->bi_sector
bio->bi_bdev
bio->bi_size
bio->bi_rw using bio_data_dir()This patch creates a new struct bvec_merge_data holding a copy of those
fields to avoid having to change them directly in the struct bio when
going down the stack only to have to change them back again on the way
back up. (And then when the bio gets mapped for real, the whole
exercise gets repeated, but that's a problem for another day...)Signed-off-by: Alasdair G Kergon
Cc: Neil Brown
Cc: Milan Broz
Signed-off-by: Jens Axboe
29 Apr, 2008
4 commits
-
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: Skip I/O merges when disabled
block: add large command support
block: replace sizeof(rq->cmd) with BLK_MAX_CDB
ide: use blk_rq_init() to initialize the request
block: use blk_rq_init() to initialize the request
block: rename and export rq_init()
block: no need to initialize rq->cmd with blk_get_request
block: no need to initialize rq->cmd in prepare_flush_fn hook
block/blk-barrier.c:blk_ordered_cur_seq() mustn't be inline
block/elevator.c:elv_rq_merge_ok() mustn't be inline
block: make queue flags non-atomic
block: add dma alignment and padding support to blk_rq_map_kern
unexport blk_max_pfn
ps3disk: Remove superfluous cast
block: make rq_init() do a full memset()
relay: fix splice problem -
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.Signed-off-by: Denis V. Lunev
Cc: Greg Kroah-Hartman
Cc: Alexey Dobriyan
Cc: "Eric W. Biederman"
Cc: Peter Osterlund
Cc: Bartlomiej Zolnierkiewicz
Cc: Dmitry Torokhov
Cc: Neil Brown
Cc: Mauro Carvalho Chehab
Cc: Bjorn Helgaas
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Use creation by full path: "driver/foo".
Signed-off-by: Alexey Dobriyan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
blk_get_request initializes rq->cmd (rq_init does) so the users don't
need to do that.The purpose of this patch is to remove sizeof(rq->cmd) and &rq->cmd,
as a preparation for large command support, which changes rq->cmd from
the static array to a pointer. sizeof(rq->cmd) will not make sense and
&rq->cmd won't work.Signed-off-by: FUJITA Tomonori
Cc: James Bottomley
Cc: Alasdair G Kergon
Cc: Jens Axboe
Signed-off-by: Jens Axboe
05 Mar, 2008
1 commit
-
On my system, pkt_open() consumes 584 bytes because the compiler decides to
inline lots of functions that would not normally be part of long call chains.
The following patch fixes that problem on my system.Signed-off-by: Peter Osterlund
Cc: Nix
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 Feb, 2008
1 commit
-
Fix various instances of
if (!expr & mask)
which should probably have been
if (!(expr & mask))
Signed-off-by: Alexey Dobriyan
Cc: Jens Axboe
Cc: Peter Osterlund
Cc: Karsten Keil
Cc: Mauro Carvalho Chehab
Cc: "Antonino A. Daplas"
Cc: Mark Fasheh
Cc: "David S. Miller"
Cc: Jeff Garzik
Cc: Al Viro
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
25 Jan, 2008
3 commits
-
There is no need for kobject_unregister() anymore, thanks to Kay's
kobject cleanup changes, so replace all instances of it with
kobject_put().Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.Cc: Jens Axboe
Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
struct class_device is going away, this converts the code to use struct
device instead.Signed-off-by: Tony Jones
Cc: Peter Osterlund
Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
18 Dec, 2007
1 commit
-
In kobject_register, the kobject reference is get in kobject_init, and then
kobject_add. If kobject_add fail, it will only cleanup the reference got
by itself.Signed-off-by: Dave Young
Reviewed-by: Pekka Enberg
Cc: Greg KH
Cc: Peter Osterlund
Cc: Jens Axboe
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
08 Nov, 2007
1 commit
-
pkt_setup_dev() expects module reference to be held on invocation.
This used to be true for sysfs callbacks but not anymore. Test and
grab module reference around pkt_setup_dev() in
class_pktcdvd_store_add().Signed-off-by: Tejun Heo
Acked-by: Peter Osterlund
Signed-off-by: Jens Axboe
16 Oct, 2007
2 commits
-
Signed-off-by: Laurent Riffard
Signed-off-by: Jens Axboe -
Signed-off-by: Jens Axboe
10 Oct, 2007
1 commit
-
As bi_end_io is only called once when the reqeust is complete,
the 'size' argument is now redundant. Remove it.Now there is no need for bio_endio to subtract the size completed
from bi_size. So don't do that either.While we are at it, change bi_end_io to return void.
Signed-off-by: Neil Brown
Signed-off-by: Jens Axboe
24 Jul, 2007
1 commit
-
Some of the code has been gradually transitioned to using the proper
struct request_queue, but there's lots left. So do a full sweet of
the kernel and get rid of this typedef and replace its uses with
the proper type.Signed-off-by: Jens Axboe
18 Jul, 2007
1 commit
-
Currently, the freezer treats all tasks as freezable, except for the kernel
threads that explicitly set the PF_NOFREEZE flag for themselves. This
approach is problematic, since it requires every kernel thread to either
set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
care for the freezing of tasks at all.It seems better to only require the kernel threads that want to or need to
be frozen to use some freezer-related code and to remove any
freezer-related code from the other (nonfreezable) kernel threads, which is
done in this patch.The patch causes all kernel threads to be nonfreezable by default (ie. to
have PF_NOFREEZE set by default) and introduces the set_freezable()
function that should be called by the freezable kernel threads in order to
unset PF_NOFREEZE. It also makes all of the currently freezable kernel
threads call set_freezable(), so it shouldn't cause any (intentional)
change of behaviour to appear. Additionally, it updates documentation to
describe the freezing of tasks more accurately.[akpm@linux-foundation.org: build fixes]
Signed-off-by: Rafael J. Wysocki
Acked-by: Nigel Cunningham
Cc: Pavel Machek
Cc: Oleg Nesterov
Cc: Gautham R Shenoy
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Jul, 2007
1 commit
-
kcdrwd() is a kernel thread, all signals are ignored.
Signed-off-by: Oleg Nesterov
Cc: Peter Osterlund
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Jul, 2007
1 commit
-
sysfs is now completely out of driver/module lifetime game. After
deletion, a sysfs node doesn't access anything outside sysfs proper,
so there's no reason to hold onto the attribute owners. Note that
often the wrong modules were accounted for as owners leading to
accessing removed modules.This patch kills now unnecessary attribute->owner. Note that with
this change, userland holding a sysfs node does not prevent the
backing module from being unloaded.For more info regarding lifetime rule cleanup, please read the
following message.http://article.gmane.org/gmane.linux.kernel/510293
(tweaked by Greg to not delete the field just yet, to make it easier to
merge things properly.)Signed-off-by: Tejun Heo
Cc: Cornelia Huck
Cc: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
26 Apr, 2007
1 commit
-
The packet driver is assuming (reasonably) that the (undocumented)
request.errors is an errno. But it is in fact some mysterious bitfield. When
things go wrong we return weird positive numbers to the VFS as pointers and it
goes oops.Thanks to William Heimbigner for reporting and diagnosis.
(It doesn't oops, but this driver still doesn't work for William)
Cc: William Heimbigner
Cc: Peter Osterlund
Cc: Jens Axboe
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
21 Feb, 2007
1 commit
-
Fixes http://bugzilla.kernel.org/show_bug.cgi?id=7810 - a silly
copy-paste bug introduced by the latest change.Signed-off-by: Gerhard Dirschl
Cc: Peter Osterlund
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Feb, 2007
1 commit
-
Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.Signed-off-by: Arjan van de Ven
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Feb, 2007
1 commit
-
- update documentation
- use clear_bdi_congested/set_bdi_congested functions directly instead of
old wrappers- removed DECLARE_BUF_AS_STRING macro
Signed-off-by: Thomas Maier
Cc: Peter Osterlund
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
06 Jan, 2007
1 commit
-
Fix http://bugzilla.kernel.org/show_bug.cgi?id=7667
This is because the packet driver tries to send down read/write BLOCK_PC
commands that don't use a bio and do not use sg lists.The right fix is to replace all the packet_command stuff in the packet
driver by scsi_execute() which needs to be lifted from scsi code to
the block code for that.Fix the bug for now. It's not the full way to a generic execute block pc
infrastcuture but fixes the bug for the time being.Signed-off-by: Christoph Hellwig
Acked-by: Peter Osterlund
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds