04 Jan, 2012
1 commit
-
Signed-off-by: Al Viro
01 Nov, 2011
2 commits
-
By removing the implicit presence of module.h from this file, we
will see things like:In file included from fs/dlm/user.c:9:
include/linux/miscdevice.h:50: error: field ‘list’ has incomplete type
include/linux/miscdevice.h:54: error: expected specifier-qualifier-list before ‘mode_t’Call out lists.h and types.h for inclusion to fix each of the
above respectively.Signed-off-by: Paul Gortmaker
-
This file has a define MODULE_ALIAS_MISCDEV which in turn will
use the MODULE_ALIAS define, but only if the former is explicitly
used by modular device driver code (and such code should be
already including module.h).Delete the include, since module.h is such a giant thing that we
don't want it implicitly sneaking into compiles where it isn't
specifically required.Signed-off-by: Paul Gortmaker
01 Aug, 2011
1 commit
-
Loop devices today have a fixed pre-allocated number of usually 8.
The number can only be changed at module init time. To find a free
device to use, /dev/loop%i needs to be scanned, and all devices need
to be opened until a free one is possibly found.This adds a new /dev/loop-control device node, that allows to
dynamically find or allocate a free device, and to add and remove loop
devices from the running system:
LOOP_CTL_ADD adds a specific device. Arg is the number
of the device. It returns the device i or a negative
error code.LOOP_CTL_REMOVE removes a specific device, Arg is the
number the device. It returns the device i or a negative
error code.LOOP_CTL_GET_FREE finds the next unbound device or allocates
a new one. No arg is given. It returns the device i or a
negative error code.The loop kernel module gets automatically loaded when
/dev/loop-control is accessed the first time. The alias
specified in the module, instructs udev to create this
'dead' device node, even when the module is not loaded.Example:
cfd = open("/dev/loop-control", O_RDWR);# add a new specific loop device
err = ioctl(cfd, LOOP_CTL_ADD, devnr);# remove a specific loop device
err = ioctl(cfd, LOOP_CTL_REMOVE, devnr);# find or allocate a free loop device to use
devnr = ioctl(cfd, LOOP_CTL_GET_FREE);sprintf(loopname, "/dev/loop%i", devnr);
ffd = open("backing-file", O_RDWR);
lfd = open(loopname, O_RDWR);
err = ioctl(lfd, LOOP_SET_FD, ffd);Cc: Tejun Heo
Cc: Karel Zak
Signed-off-by: Kay Sievers
Signed-off-by: Jens Axboe
21 Aug, 2010
1 commit
-
Recent modprobe and udev versions allow to create device nodes
for modules which are not loaded. Only the first access will cause
the in-kernel module loader to pull-in the module. Systems which
never access the device node will not needlessly load the module,
and no longer need init scripts or other facilities to unconditionally
load it.Signed-off-by: Kay Sievers
Signed-off-by: Dmitry Torokhov
12 Aug, 2010
1 commit
-
Add devname:mapper/control and MAPPER_CTRL_MINOR module alias
to support dm-mod module autoloading.Signed-off-by: Kay Sievers
Signed-off-by: Peter Rajnoha
Signed-off-by: Alasdair G Kergon
09 Jun, 2010
1 commit
-
10, 233 is allocated officially to /dev/kmview which is shipping in
Ubuntu and Debian distributions. vhost_net seem to have borrowed it
without making a proper request and this causes regressions in the other
distributions.vhost_net can use a dynamic minor so use that instead. Also update the
file with a comment to try and avoid future misunderstandings.cc: stable@kernel.org
Signed-off-by: Alan Cox
[ We should have caught this before 2.6.34 got released. - Linus ]
Signed-off-by: Linus Torvalds
26 May, 2010
1 commit
-
This adds:
alias: devname:
to some common kernel modules, which will allow the on-demand loading
of the kernel module when the device node is accessed.Ideally all these modules would be compiled-in, but distros seems too
much in love with their modularization that we need to cover the common
cases with this new facility. It will allow us to remove a bunch of pretty
useless init scripts and modprobes from init scripts.The static device node aliases will be carried in the module itself. The
program depmod will extract this information to a file in the module directory:
$ cat /lib/modules/2.6.34-00650-g537b60d-dirty/modules.devname
# Device nodes to trigger on-demand module loading.
microcode cpu/microcode c10:184
fuse fuse c10:229
ppp_generic ppp c108:0
tun net/tun c10:200
dm_mod mapper/control c10:235Udev will pick up the depmod created file on startup and create all the
static device nodes which the kernel modules specify, so that these modules
get automatically loaded when the device node is accessed:
$ /sbin/udevd --debug
...
static_dev_create_from_modules: mknod '/dev/cpu/microcode' c10:184
static_dev_create_from_modules: mknod '/dev/fuse' c10:229
static_dev_create_from_modules: mknod '/dev/ppp' c108:0
static_dev_create_from_modules: mknod '/dev/net/tun' c10:200
static_dev_create_from_modules: mknod '/dev/mapper/control' c10:235
udev_rules_apply_static_dev_perms: chmod '/dev/net/tun' 0666
udev_rules_apply_static_dev_perms: chmod '/dev/fuse' 0666A few device nodes are switched to statically allocated numbers, to allow
the static nodes to work. This might also useful for systems which still run
a plain static /dev, which is completely unsafe to use with any dynamic minor
numbers.Note:
The devname aliases must be limited to the *common* and *single*instance*
device nodes, like the misc devices, and never be used for conceptually limited
systems like the loop devices, which should rather get fixed properly and get a
control node for losetup to talk to, instead of creating a random number of
device nodes in advance, regardless if they are ever used.This facility is to hide the mess distros are creating with too modualized
kernels, and just to hide that these modules are not compiled-in, and not to
paper-over broken concepts. Thanks! :)Cc: Greg Kroah-Hartman
Cc: David S. Miller
Cc: Miklos Szeredi
Cc: Chris Mason
Cc: Alasdair G Kergon
Cc: Tigran Aivazian
Cc: Ian Kent
Signed-Off-By: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
15 Jan, 2010
1 commit
-
What it is: vhost net is a character device that can be used to reduce
the number of system calls involved in virtio networking.
Existing virtio net code is used in the guest without modification.There's similarity with vringfd, with some differences and reduced scope
- uses eventfd for signalling
- structures can be moved around in memory at any time (good for
migration, bug work-arounds in userspace)
- write logging is supported (good for migration)
- support memory table and not just an offset (needed for kvm)common virtio related code has been put in a separate file vhost.c and
can be made into a separate module if/when more backends appear. I used
Rusty's lguest.c as the source for developing this part : this supplied
me with witty comments I wouldn't be able to write myself.What it is not: vhost net is not a bus, and not a generic new system
call. No assumptions are made on how guest performs hypercalls.
Userspace hypervisors are supported as well as kvm.How it works: Basically, we connect virtio frontend (configured by
userspace) to a backend. The backend could be a network device, or a tap
device. Backend is also configured by userspace, including vlan/mac
etc.Status: This works for me, and I haven't see any crashes.
Compared to userspace, people reported improved latency (as I save up to
4 system calls per packet), as well as better bandwidth and CPU
utilization.Features that I plan to look at in the future:
- mergeable buffers
- zero copy
- scalability tuning: figure out the best threading model to useNote on RCU usage (this is also documented in vhost.h, near
private_pointer which is the value protected by this variant of RCU):
what is happening is that the rcu_dereference() is being used in a
workqueue item. The role of rcu_read_lock() is taken on by the start of
execution of the workqueue item, of rcu_read_unlock() by the end of
execution of the workqueue item, and of synchronize_rcu() by
flush_workqueue()/flush_work(). In the future we might need to apply
some gcc attribute or sparse annotation to the function passed to
INIT_WORK(). Paul's ack below is for this RCU usage.(Includes fixes by Alan Cox ,
David L Stevens ,
Chris Wright )Acked-by: Rusty Russell
Acked-by: Arnd Bergmann
Acked-by: "Paul E. McKenney"
Signed-off-by: Michael S. Tsirkin
Signed-off-by: David S. Miller
20 Sep, 2009
1 commit
-
This allows subsytems to provide devtmpfs with non-default permissions
for the device node. Instead of the default mode of 0600, null, zero,
random, urandom, full, tty, ptmx now have a mode of 0666, which allows
non-privileged processes to access standard device nodes in case no
other userspace process applies the expected permissions.This also fixes a wrong assignment in pktcdvd and a checkpatch.pl complain.
Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
16 Jun, 2009
1 commit
-
This adds support for misc devices to report their requested nodename to
userspace. It also updates a number of misc drivers to provide the
needed subdirectory and device name to be used for them.Signed-off-by: Kay Sievers
Signed-off-by: Jan Blunck
Signed-off-by: Greg Kroah-Hartman
14 Mar, 2009
1 commit
-
Signed-off-by: Eric Moore
Signed-off-by: James Bottomley
26 Nov, 2008
1 commit
-
Move FUSE_MINOR to miscdevice.h. While at it, de-uglify the file.
Signed-off-by: Tejun Heo
Signed-off-by: Miklos Szeredi
20 Apr, 2008
1 commit
-
After 2.6.24 there was a plan to make the PM core acquire all device
semaphores during a suspend/hibernation to protect itself from
concurrent operations involving device objects. That proved to be
too heavy-handed and we found a better way to achieve the goal, but
before it happened, we had introduced the functions
device_pm_schedule_removal() and destroy_suspended_device() to allow
drivers to "safely" destroy a suspended device and we had adapted some
drivers to use them. Now that these functions are no longer necessary,
it seems reasonable to remove them and modify their users to use the
normal device unregistration instead.Signed-off-by: Rafael J. Wysocki
Acked-by: Pavel Machek
Signed-off-by: Greg Kroah-Hartman
06 Feb, 2008
1 commit
-
Make it possible to unregister a misc device object in a safe way during a
suspend/resume cycle.Signed-off-by: Rafael J. Wysocki
Cc: Michael Buesch
Cc: Pavel Machek
Cc: "John W. Linville"
Cc: Alan Stern
Cc: Len Brown
Cc: Greg KH
Cc: Kay Sievers
Cc: Richard Purdie
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
03 May, 2007
1 commit
-
Use the minor number (232) allocated to kvm by lanana.
Signed-off-by: Avi Kivity
02 Dec, 2006
1 commit
-
This also ment that some of the misc drivers had to also be fixed
up as they were assuming the device was a class_device.Signed-off-by: Greg Kroah-Hartman
27 Jun, 2006
1 commit
-
Also fixes all drivers that set this field.
Signed-off-by: Greg Kroah-Hartman
29 Mar, 2006
1 commit
-
Mark the f_ops members of inodes as const, as well as fix the
ripple-through this causes by places that copy this f_ops and then "do
stuff" with it.Signed-off-by: Arjan van de Ven
Signed-off-by: Alexey Dobriyan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Apr, 2005
1 commit
-
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.Let it rip!