- 19 Nov, 2002 10 commits
-
-
Patrick Mochel authored
This makes the driver model core (for devices) exploit the kobject infrastructure more and make the resulting code quite a bit simpler. For one, device_register() mimmicks kobject_register() in that it now only calls device_initialize() and device_add() back to back. Similarly, device_unregister() calls device_del() and put_device() consecutively. device_del() no longer removes and frees the device, it only removes them. It also removes the devices from the global and sibling lists. This was previously done by device_put(), but moved here to be symmetrical with device_add(). The device's parent is now only incremented in device_add() and decremented in device_del(), fixing a bug in which the parent's refcount was incremented twice. Because of these simplifications, the core can easily be converted to use the kobject reference counting infrastructure. get_device() now simply forwards the call to kobject_get() and ditto for put_device(). device_release() is implemented to handle the freeing of devices once their reference count reaches 0. Since we're using the kobject refcounting model, we no longer need the checking or setting of the device state field, so it has been removed. The only users of it were the power routines. In those, it is implicit that we have a valid device, since we've already taken device_sem, and we're walking the list (all modifications are protected by device_sem). struct device::lock, and the helpers to lock/unlock have been removed. No one has ever used them, and no one is likely to use them.
-
Patrick Mochel authored
-
Patrick Mochel authored
sysfs has always had a bug that would allow a read-only file to be opened for writing. It has also returned 0 on write when there was no store method defined for the file. This addresses both via sysfs_open_file(). It checks the flags the file was opened with and compares them with the mode of the inode. If the mode does not support the flags passed, -EPERM is returned. If the sysfs_ops for the object does not have the correct method for the flags, -EACCESS is returned. Since all checks happen on open(), the corresponding checks in the read() and write() methods have been removed.
-
Patrick Mochel authored
into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-kobject
-
Linus Torvalds authored
from "write()" is an error condition, and hang retrying. Return EINVAL in sysfs instead.
-
Linus Torvalds authored
into home.transmeta.com:/home/torvalds/v2.5/linux
-
David Woodhouse authored
-
David Woodhouse authored
-
Andries E. Brouwer authored
-
Ben Fennema authored
-
- 18 Nov, 2002 30 commits
-
-
Patrick Mochel authored
The interface should now be more sane and protect against races better. kobject_register() was split into two helpers: kobject_init() and kobject_add(). It calls both consecutively, though both are also exposed for use by users that want to use the objects w/o adding them to the object hierarchy. kobject_unregister() was made simply a wrapper for kobject_del() and kobject_put(), which are both also exposed. The guts of kobject_put() was moved into kobject_cleanup(), which it calls when the reference count hits 0. (This was done for clarity). The infrastructure now takes a lot in kobject_get() and kobject_put() when checking and modifying the objects' reference counts. This was an obvious one that hsould have been fixed long ago. kobject_add() increments the refcount of the object, which is decremented when kobject_del() is called. This guarantees that the object's memory cannot be freed if it has been added to the hierarchy, and kobject_del() has not been called on it. kobject_init() is now the function that increments the refcount on the object's subsystem, which is decremented only after its release() method has been called for the object in kobject_cleanup(). The documentation has been updated to reflect these changes.
-
Andries E. Brouwer authored
These security_ops are declared like int (*inode_mknod) (struct inode *dir, struct dentry *dentry, int mode, dev_t dev); with a mode and a dev_t argument. But the users mistakenly had major, minor instead of mode, dev.
-
Art Haas authored
-
Art Haas authored
-
Art Haas authored
-
Art Haas authored
-
Trond Myklebust authored
Given Andi Kleen's patch that introduces of VFS-level support for nanosecond time resolutions, we should finally be able to export the existing NFS client level support to userland. In order to do so, the following patch will convert all NFS private 'raw u64' values into the kernel-supported struct timespec directly in the xdr_encode/xdr_decode routines. It adds support for the nanosecond field in NFS 'setattr' calls, and in nfs_refresh_inode(). Finally, there are a few cleanups in the nfs_refresh_inode code that convert multiple use of the NFS_*(inode) macros into a single dereference of NFS_I(inode).
-
Robert Love authored
Fix numerous ALSA core compiler warnings of the type "unused variable foo"
-
bk://are.twiddle.net/math-emuLinus Torvalds authored
into home.transmeta.com:/home/torvalds/v2.5/linux
-
bk://are.twiddle.net/axp-2.5Linus Torvalds authored
into home.transmeta.com:/home/torvalds/v2.5/linux
-
Linus Torvalds authored
was enabled, so split it up into "extable.c"
-
Patrick Mochel authored
-
Patrick Mochel authored
I thought this had been fixed some time ago, but must have never been picked up..
-
Patrick Mochel authored
Convert it to #undef DEBUG.
-
Patrick Mochel authored
devclass_{add,remove}_driver() had been implemented, but had never been called.
-
Patrick Mochel authored
This way, we make sure the driver gets added to the class's list and is exported correctly in sysfs.
-
Linus Torvalds authored
into home.transmeta.com:/home/torvalds/v2.5/linux
-
Linus Torvalds authored
into home.transmeta.com:/home/torvalds/v2.5/linux
-
Rusty Russell authored
Since I believe kallsyms is important, this reimplements it sanely, using the current module infrastructure, and not using an external kallsyms script. FYI, the previous interface was: int kallsyms_symbol_to_address( const char *name, /* Name to lookup */ unsigned long *token, /* Which module to start with */ const char **mod_name, /* Set to module name or "kernel" */ unsigned long *mod_start, /* Set to start address of module */ unsigned long *mod_end, /* Set to end address of module */ const char **sec_name, /* Set to section name */ unsigned long *sec_start, /* Set to start address of section */ unsigned long *sec_end, /* Set to end address of section */ const char **sym_name, /* Set to full symbol name */ unsigned long *sym_start, /* Set to start address of symbol */ unsigned long *sym_end /* Set to end address of symbol */ ); The new one is: /* Lookup an address. modname is set to NULL if it's in the kernel. */ const char *kallsyms_lookup(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, char **modname);
-
Patrick Mochel authored
...since macro using it was changed from #if to #ifdef..
-
James Morris authored
-
James Morris authored
-
Richard Henderson authored
-
http://linux-acpi.bkbits.net/linux-acpiLinus Torvalds authored
into home.transmeta.com:/home/torvalds/v2.5/linux
-
Richard Henderson authored
-
David S. Miller authored
-
Alexey Kuznetsov authored
- Implement policy timeouts. - Make PF_KEY return proper error from KM acquire.
-
Chris Wilson authored
-
Eric Brower authored
-
James Morris authored
-