1. 30 Oct, 2002 2 commits
    • Patrick Mochel's avatar
      sysfs: kill struct sysfs_dir. · 332ad69d
      Patrick Mochel authored
      Previously, sysfs read() and write() calls looked for sysfs_ops in the struct 
      sysfs_dir, in the kobject. Since objects belong to a subsystem, and is a member
      of a group of like devices, the sysfs_ops have been moved to struct subsystem,
      and are referenced from there.
      
      The only remaining member of struct sysfs_dir is the dentry of the object's 
      directory. That is moved out of the dir struct and directly into struct kobject.
      That saves us 4 bytes/object.
      
      All of the sysfs functions that referenced the struct have been changed to just
      reference the dentry.
      332ad69d
    • Patrick Mochel's avatar
      Introduce struct subsystem. · a6c066de
      Patrick Mochel authored
      A struct subsystem is basically a collection of objects of a certain type,
      and some callbacks to operate on objects of that type. 
      
      subsystems contain embedded kobjects themselves, and have a similar set of 
      library routines that kobjects do, which are mostly just wrappers for the
      correlating kobject routines. 
      
      kobjects are inserted in depth-first order into their subsystem's list of 
      objects. Orphan kobjects are also given foster parents that point to their
      subsystem. This provides a bit more rigidity in the hierarchy, and disallows
      any orphan kobjects.
      
      When an object is unregistered, it is removed from its subsystem's list. When
      the objects' refcount hits 0, the subsystem's ->release() callback is called. 
      
      Documentation describing the objects and the interfaces has also been added.
      a6c066de
  2. 29 Oct, 2002 38 commits
    • Patrick Mochel's avatar
      sysfs: make symlinks easier. · 0862416e
      Patrick Mochel authored
      It's now
      
      int sysfs_create_link(struct kobject * kobj, struct kobject * target, char * name)
      
      So, the caller doesn't have to determine the path of the target nor the depth of
      the object we're creating the symlink for; it's all taken care of.
      0862416e
    • Patrick Mochel's avatar
      Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin · d2f8eca7
      Patrick Mochel authored
      into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-kobject
      d2f8eca7
    • Randy Dunlap's avatar
      [PATCH] remove double-init in /proc/ksyms · d8c084f9
      Randy Dunlap authored
      This removes a small thinko (2 of: n = *pos) in kernel/module.c's
      s_start() function.
      d8c084f9
    • Alexander Viro's avatar
      [PATCH] more shm/loop updates · dd53e3fa
      Alexander Viro authored
      Ok, with this simple fix loop builds and loop works no worse than the
      old shm/loop approach (better - it does boot).
      
      However, both 2.4.44+ and this animal have the same and rather odd
      breakage in loop-over-device.  Loop-over-file works fine, but loop over
      device gives random crap on reads.  And no, it's not a problem with
      underlying device itself - something happens in loop.c.
      
      I'm going down right now, so I'll be back in several hours and will try
      to debug it.  Hopefully by the morning I'll have a fix.
      dd53e3fa
    • John Levon's avatar
      [PATCH] fix oprofile multiple counters · b69c3847
      John Levon authored
      This ensures we deal properly with multiple perfctr overflow interrupts
      under high load.
      b69c3847
    • John Levon's avatar
      [PATCH] add oprofile to MAINTAINERS · d48dde40
      John Levon authored
      d48dde40
    • Brian Gerst's avatar
      [PATCH] factor common GCC options check · 8978d683
      Brian Gerst authored
      Make the test for supported GCC options into a macro, and add new checks
      for -march={winchip-c6,winchip2,c3}.
      8978d683
    • Rusty Russell's avatar
      [PATCH] Get rid of check_resource() before it becomes a problem · 5b8e28f3
      Rusty Russell authored
      The new resource interface foolishly replicated the (obsolete,
      racy) spirit of the check_region call as check_resource.  You
      should use request_resource/release_resource instead.
      5b8e28f3
    • Alexander Viro's avatar
      [PATCH] compile fixes · d5c74234
      Alexander Viro authored
      d5c74234
    • Adam Kropelin's avatar
      [PATCH] sd.c major number off-by-one · 06a9b8fe
      Adam Kropelin authored
      Fix an off-by-one error in the simplified SD_MAJOR macro which not only
      botches up the sd majors but also steals away the major used by my
      favorite slow-than-dirt SCSI RAID controller: cpqarray. Please, can I
      have it back?
      06a9b8fe
    • Alexander Viro's avatar
      [PATCH] loop/shmfs fixes · 5e5ac463
      Alexander Viro authored
       - add lo->lo_blocksize
       - kill lo_get_bs() - great name, but...
       - set ->lo_device only if we do have a block device
       - pull determination of ->lo_blocksize into both branches - bdev
         variant gets it from lo_device and file one uses ->i_blocksize.
       - switched the ioctl getting information about underlying object
         to lo->lo_device ? stat.rdev : stat.dev
       - i.e. st_rdev of underlying object if it's a device and st_dev - if it's
         a file.
       - reverted the bogosity in shmem.c
      5e5ac463
    • Patrick Mochel's avatar
      sysfs: marry api with struct kobject. · eda52025
      Patrick Mochel authored
      This works on obviating the need for a separate data type to describe a sysfs
      directory (which was renamed from struct driver_dir_entry to struct sysfs_dir).
      
      All sysfs creation and removal functions now take a struct kobject, instead
      of a struct sysfs_dir. This kobject is embedded in ->d_fsdata of the directory.
      
      sysfs_create_dir() takes only 1 parameter now: the object that we're creating
      the directory for. The parent dentry is derived by looking at the object's 
      parent. 
      
      sysfs_create_file() takes the object as the first parameter, and the attribute
      as the second, which makes more sense from an API perspective. 
      
      sysfs_remove_file() now takes an attribute as a second parameter, to be 
      consistent with the creation function.
      
      sysfs_remove_link() is created, which is basically the old sysfs_remove_file().
      (symlinks don't have an attribute associated with them; only a name, which was
      prohibiting the previous change). 
      
      open() and close() look for a kobject now, and do refcounting directly on the
      object. Because of that, we don't need the ->open() and ->close() callbacks
      in struct sysfs_ops, so they've been removed. 
      
      read() and write() also now look for a kobject now. 
      
      The comments have been updated, too. 
      eda52025
    • Neil Brown's avatar
      159ecf44
    • Patrick Mochel's avatar
    • Patrick Mochel's avatar
      introduce struct kobject: simple, generic object for embedding in other structures. · 736c7efc
      Patrick Mochel authored
      This is not meant to be fancy; just something simple for which we can 
      control the refcount and other common functionality using common code. 
         
      The basic operations for registration and reference count manipulation are
      included. 
      736c7efc
    • Linus Torvalds's avatar
      Merge http://gkernel.bkbits.net/misc-2.5 · 972b8494
      Linus Torvalds authored
      into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
      972b8494
    • Jeff Garzik's avatar
    • Jeff Garzik's avatar
      Merge redhat.com:/home/jgarzik/repo/linus-2.5 · f144c7fc
      Jeff Garzik authored
      into redhat.com:/home/jgarzik/repo/misc-2.5
      f144c7fc
    • Andrew Morton's avatar
      [PATCH] tmpfs: support loopback · 7fc97e8d
      Andrew Morton authored
      Patch from Hugh Dickins
      
      Added shmem_readpage and shmem_prepare_write so tmpfs files can be used
      by the loop driver (together with simple_commit_write).  shmem_getpage
      extended to accept file page passed in, which may have to be copied
      over from swap page.
      
      Use bdget and sb_set_blocksize so loop can see our preferred blocksize
      PAGE_CACHE_SIZE.  Use copy_highpage, removed from highmem.h in 2.4.17:
      restore it but with kmap_atomics.  Restore (a simple) copy_page to
      asm-sparc64/page.h, which alone of all arches discarded it.
      7fc97e8d
    • Andrew Morton's avatar
      [PATCH] tmpfs: shmem_getpage missing flush_dcache_page · f013c26d
      Andrew Morton authored
      Patch from Hugh Dickins
      
      From Matthew Wilcox <willy@debian.org>: shmem_getpage must
      flush_dcache_page after allocating and clearing a new page.
      f013c26d
    • Andrew Morton's avatar
      [PATCH] tmpfs: shmem_file_write update · e666acdf
      Andrew Morton authored
      Patch from Hugh Dickins
      
      Checked shmem_file_write against recent filemap source, and against
      2.4 and 2.4-ac: folded in missing fixes, mostly related to far file
      positions.  Plus the new kmap_atomic copying technique.  But for now,
      as before, no mark_page_accessed or SetPageReferenced in shmem.c: add
      those, or whatever, later on when akpm has reviewed usage elsewhere.
      e666acdf
    • Andrew Morton's avatar
      [PATCH] tmpfs: shmem_file_sendfile · 2f28cc35
      Andrew Morton authored
      Patch from Hugh Dickins
      
      Added shmem_file_sendfile to allow sendfile from tmpfs.  Checked
      do_shmem_file_read and shmem_file_read against filemap equivalents
      to add in any recent fixes (-EINVAL when count < 0 was missing).
      2f28cc35
    • Andrew Morton's avatar
      [PATCH] tmpfs: shmem fs cleanup · 1956960b
      Andrew Morton authored
      Patch from Hugh Dickins
      
      Remove obsolete shmem_fs_type: we were in some doubt whether safe yet
      to do so, then found 2.5.4 typo changed it from 2.4's "shm" to "shmem"
      ever since: nobody complained, delete it - we're "tmpfs" since 2.4.4.
      Use libfs' simple_empty and simple_sync_file instead of homegrown.
      Remove exit_shmem_fs, it fools people that this might be a module.
      Allow for faint possibility that shm_mnt could not be initialized.
      1956960b
    • Andrew Morton's avatar
      [PATCH] tmpfs: shmem_getpage reading holes · 2671b00a
      Andrew Morton authored
      Patch from Hugh Dickins
      
      Here I intended a patch to remove the unsatisfactory shmem_recalc_inode
      (which tries to work out when vmscan has freed undirtied hole pages,
      to relax its blocks-in-use limit; but can only do so per-inode when it
      needs to be per-super).  I had hoped to use the releasepage method, but
      it looks like it can't quite be bent to this task, the page might still
      be rebusied after release.  2.4-ac uses a removepage method dedicated to
      this, but I'm reluctant to ask for such a minor address_space_operation.
      
      So, leave shmem_recalc_inode as is, but avoid the issue as much as
      possible, by letting shmem_getpage use the empty_zero_page instead of
      allocating when a hole is read (but this cannot be done when it's being
      mapped, nowadays the nopage doesn't know if page will be copied or not).
      Whereupon shmem_getpage(,,,SGP_READ) can do partial trunc's holdpage.
      2671b00a
    • Andrew Morton's avatar
      [PATCH] tmpfs: shmem_getpage beyond eof · 3c840525
      Andrew Morton authored
      Patch from Hugh Dickins
      
      The last set of tmpfs patches left shmem_getpage with an inadequate
      next_index test to guard against races with truncation.  Now remove
      that check and settle the issue with checks against i_size within
      shmem_swp_alloc, which needs to know whether reading or writing.
      3c840525
    • Andrew Morton's avatar
      [PATCH] tmpfs: shmem_getpage unlock_page · e7e27221
      Andrew Morton authored
      Patch from Hugh Dickins
      
      shmem_getpage does need to lock its page (to secure it against
      shmem_writepage), but it's easier for its callers if it unlocks
      before returning.  The only caller who appeared to be using the
      page lock was shmem_file_write, but it wasn't actually protecting
      against anything - i_sem prevents concurrent writes and truncates,
      and do_shmem_file_read was dropping the lock before copying anyway.
      e7e27221
    • Alexander Viro's avatar
      [PATCH] removal of root_dev_names[] · 51924607
      Alexander Viro authored
       - name_to_kdev_t() turned into name_to_dev_t(), callers updated.
       - table of names is gone, we use driverfs instead.
      
       - root name is converted to dev_t only at prepare_namespace() time - we
         use to do it in setup and we need it after driver initialization.  So
         setup only stores the root name and leaves the work to
         prepare_namespace().
      
       - disk names for rd and cm206 changed to match the old behaviour of
         root= parser: ramdisks have ram<n> in ->disk_name now (instead of
         rd<n>) and cm206 - cm206cd (instead of cm206).
      51924607
    • Pavel Machek's avatar
      [PATCH] swsusp updates · 82b3980b
      Pavel Machek authored
      This uses better constraints that do not go through the register
      unneccessarily.
      82b3980b
    • Pavel Machek's avatar
      [PATCH] swsusp -- small fixes · 24cc3559
      Pavel Machek authored
      Do not oops when no swapfile is available and make it compile on
      DISCONTIGMEM machines.
      24cc3559
    • Brian Gerst's avatar
      [PATCH] i386 __verify_write fixes · d7952bdd
      Brian Gerst authored
      This patch does a few cleanups/fixes with __verify_write:
       - Only compile it when needed.
       - Move test for KERNEL_DS out of line.
       - The mmap semaphore is needed to access the vma list.
       - Use fixmap for the WP test.
       - Removes an obsolete comment in fixmap.h
      d7952bdd
    • Brian Gerst's avatar
      [PATCH] remove __verify_write from sh arch · 10531a52
      Brian Gerst authored
      It was copied from i386 and is unused.
      10531a52
    • Christoph Hellwig's avatar
      83e1ce3f
    • Brian Gerst's avatar
      [PATCH] make x86 ptrace use init_fpu() · f8542e1c
      Brian Gerst authored
      This fixes PTRACE_GETFPREGS to initilize the fpu struct correctly on
      cpus with fxsr, as well as removing redundant code.
      f8542e1c
    • Alexander Viro's avatar
      [PATCH] gendisk fixes · 22dda8bf
      Alexander Viro authored
       - fixes an idiocy with floppy_find() et.al. - they forgot to set
         *part to 0.  As the result, open() on anything other than fd0 had
         lead to interesting effects...
      
       - fixes off-by-1 in set_disk_ro().
      22dda8bf
    • Linus Torvalds's avatar
      Fix up horribly wrong test in new copy-to-user() · b3caff53
      Linus Torvalds authored
      implementation. The optimized versions only work
      for large areas, make sure we don't use them for
      anything else.
      b3caff53
    • Linus Torvalds's avatar
      Fix ACPI frequency states to not play games with the · 808c016c
      Linus Torvalds authored
      configuration system, and instead just cleanly show
      the dependency.
      808c016c
    • Christoph Hellwig's avatar
      [PATCH] sanitize intel movsl selection · 51b14c76
      Christoph Hellwig authored
      The ifdef <actual cpu selection> is very bad style, we usually introduce
      feature CONFIG_ options in config.in instead.
      51b14c76
    • Linus Torvalds's avatar
      Merge bk://linuxusb.bkbits.net/pci_hp-2.5 · 1d4123ec
      Linus Torvalds authored
      into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
      1d4123ec