28 Mar, 2006

40 commits

  • Cache_fresh is now only used in cache.c, so unexport it.

    Part of cache_fresh (setting CACHE_VALID) should really be done under the
    lock, while part (calling cache_revisit_request etc) must be done outside the
    lock. So we split it up appropriately.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • This has been replaced by more traditional code.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • - in cache_check, h must be non-NULL as it has been de-referenced,
    so don't bother checking for NULL.

    - When a cache-item is updated, we need to call cache_revisit_request to see
    if there is a pending request waiting for that item. We were using
    a transition to CACHE_VALID to see if that was needed, however that is
    wrong as an expired entry will still be marked 'valid' (as the data is valid
    and will need to be released). So instead use an off transition for
    CACHE_PENDING which is exactly the right thing to test.

    - Add a little bit more debugging info.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • The C++-like 'template' approach proves to be too ugly and hard to work with.

    The old 'template' won't go away until all users are updated.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • These were an unnecessary wart. Also only have one 'DefineSimpleCache..'
    instead of two.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Current svc_expkey holds a pointer to the svc_export structure, so updates to
    that structure have to be in-place, which is a wart on the whole cache
    infrastruct. So we break that linkage and just do a second lookup.

    If this became a performance issue, it would be possible to put a direct link
    back in which was only used conditionally. i.e. when an object is replaced
    in the cache, we set a flag in the old object. When dereferencing the link
    from svc_expkey, if the flag is set, we drop the reference and do a fresh
    lookup.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • The 'auth_domain's are simply handles on internal data structures. They do
    not cache information from user-space, and forcing them into the mold of a
    'cache' misrepresents their true nature and causes confusion.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Fix accidental underflow of the atomic counter.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • This functionality is also need for operation of autofs v5 direct mounts.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • We have to have a valid sbi here, or we'd have oopsed already. (There's a
    dereference of sbi->catatonic a few lines above)

    Coverity #740

    Signed-off-by: Dave Jones
    Cc: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Jones
     
  • Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • This patch define a new autofs packet for autofs v5 and updates the waitq.c
    functions to handle the additional packet type.

    Signed-off-by: Ian Kent
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • This patch adds expire logic for autofs direct mounts.

    Signed-off-by: Ian Kent
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • This patch adds a follow_link inode method for the root of an autofs direct
    mount trigger. It also adds the corresponding mount options and updates the
    show_mount method.

    Signed-off-by: Ian Kent
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • In order to be able to trigger a mount using the follow_link inode method the
    nameidata struct that is passed in needs to have the vfsmount of the autofs
    trigger not its parent.

    During a path walk if an autofs trigger is mounted on a dentry, when the
    follow_link method is called, the nameidata struct contains the vfsmount and
    mountpoint dentry of the parent mount while the dentry that is passed in is
    the root of the autofs trigger mount. I believe it is impossible to get the
    vfsmount of the trigger mount, within the follow_link method, when only the
    parent vfsmount and the root dentry of the trigger mount are known.

    This patch updates the nameidata struct on entry to __do_follow_link if it
    detects that it is out of date. It moves the path_to_nameidata to above
    __do_follow_link to facilitate calling it from there. The dput_path is moved
    as well as that seemed sensible. No changes are made to these two functions.

    Signed-off-by: Ian Kent
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Update autofs4 version.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Change the functions may_umount and may_umount_tree to boolean functions to
    aid code readability.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Rename the function simple_empty_nolock to __simple_empty in line with kernel
    naming conventions.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Whitespace and formating changes to waitq code.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Add show_options method to display autofs4 mount options in the proc
    filesystem.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Remove the update of i_atime from autofs4 in favour of having VFS update it.
    i_atime is never used for expire in autofs4.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Alter the expire semantics that define how "busyness" is determined.
    Currently a last_used counter is updated on every revalidate from processes
    other than the mount owner process group.

    This patch changes that so that an expire candidate is busy only if it has a
    reference count greater than the expected minimum, such as when there is an
    open file or working directory in use.

    This method is the only way that busyness can be established for direct mounts
    within the new implementation. For consistency the expire semantic is made
    the same for all mounts.

    A side effect of the patch is that mounts which remain mounted unessessarily
    in the presence of some GUI programs that scan the filesystem should now
    expire.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Fix the case where an expire returns busy on a tree mount when it is in fact
    not busy. This case was overlooked when the patch to prevent the expiring
    away of "scaffolding" directories for tree mounts was applied.

    The problem arises when a tree of mounts is a member of a map with other keys.
    The current logic will not expire the tree if any other mount in the map is
    busy. The solution is to maintain a "minimum" use count for each autofs
    dentry and compare this to the actual dentry usage count during expire.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Simplify the expire tree traversal code by using a function from namespace.c
    to calculate the next entry in the top down tree traversals carried out during
    the expire operation.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Change the names of the boolean functions autofs4_check_mount and
    autofs4_check_tree to autofs4_mount_busy and autofs4_tree_busy respectively
    and alters their return codes to suit in order to aid code readabilty.

    A couple of white space cleanups are included as well.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Addresse a problem where stale dentrys stop mounts from happening.

    When a mount point directory is pre-created and a non-existent entry within it
    is requested a dentry ends up being created within the mount point directory
    which stops future mounts. The problem is solved by ignoring negative,
    unhashed dentrys in the mount point d_subdirs list.

    Additionally the apparent cacheing of -ENOENT returns from requests is
    removed. The test on d_time is a tautology and d_time is not initialised and
    has an unexpected value. In short it doesn't do what it's meant to.

    The cacheing of failed requests to the daemon is important and will be
    followed up later.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Change readdir routines to use the cursor based routines in libfs.c. This
    removes reliance on old readdir code from 2.4 and should improve efficiency of
    readdir in autofs4.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Whitespace and formating changes to lookup code.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Noted by Oleg Drokin:
    We initialized an extra slot of struct kstatfs.spare, sometimes
    causing stack corruption.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Cc: Oleg Drokin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This fixes a race in the starting of write_sigio_thread. Previously, some of
    the data needed by the thread was initialized after the clone. If the thread
    ran immediately, it would see the uninitialized data, including an empty
    pollfds, which would cause it to hang.

    We move the data initialization to before the clone, and adjust the error
    paths and cleanup accordingly.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Behavior when booting two UMLs with the same umid was broken. The second one
    would steal the umid. This fixes that, making the second UML take a random
    umid instead.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This fixes a process segfault where a signal was being delivered such that a
    new stack page needed to be allocated to hold the signal frame. This was
    tripping some logic in the page fault handler which wouldn't allocate the page
    if the faulting address was more that 32 bytes lower than the current stack
    pointer. Since a signal frame is greater than 32 bytes, this exercised that
    case.

    It's fixed by updating the SP in the pt_regs before starting to copy the
    signal frame. Since those are the registers that will be copied on to the
    stack, we have to be careful to put the original SP, not the new one which
    points to the signal frame, on the stack.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This adds a 'c' option to the ubd switch which turns off host file locking so
    that the device can be shared, as with a cluster. There's also some
    whitespace cleanup while I was in this file.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This rearranges the OS declarations by moving some declarations into os.h.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike