]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/autofs4/root.c
[PATCH] autofs4: rename simple_empty_nolock function
[linux-2.6-omap-h63xx.git] / fs / autofs4 / root.c
index d196712c4b9449b16ae9438c9282f09e163c5ad0..dcd4802a5d5fb1b1e8c3ab9e9750c8aa544ac3d6 100644 (file)
@@ -84,24 +84,6 @@ static int autofs4_root_readdir(struct file *file, void *dirent,
        return dcache_readdir(file, dirent, filldir);
 }
 
-/* Update usage from here to top of tree, so that scan of
-   top-level directories will give a useful result */
-static void autofs4_update_usage(struct vfsmount *mnt, struct dentry *dentry)
-{
-       struct dentry *top = dentry->d_sb->s_root;
-
-       spin_lock(&dcache_lock);
-       for(; dentry != top; dentry = dentry->d_parent) {
-               struct autofs_info *ino = autofs4_dentry_ino(dentry);
-
-               if (ino) {
-                       touch_atime(mnt, dentry);
-                       ino->last_used = jiffies;
-               }
-       }
-       spin_unlock(&dcache_lock);
-}
-
 static int autofs4_dir_open(struct inode *inode, struct file *file)
 {
        struct dentry *dentry = file->f_dentry;
@@ -246,10 +228,9 @@ out:
        return dcache_readdir(file, dirent, filldir);
 }
 
-static int try_to_fill_dentry(struct vfsmount *mnt, struct dentry *dentry, int flags)
+static int try_to_fill_dentry(struct dentry *dentry, int flags)
 {
-       struct super_block *sb = mnt->mnt_sb;
-       struct autofs_sb_info *sbi = autofs4_sbi(sb);
+       struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
        struct autofs_info *ino = autofs4_dentry_ino(dentry);
        int status = 0;
 
@@ -323,12 +304,9 @@ static int try_to_fill_dentry(struct vfsmount *mnt, struct dentry *dentry, int f
                }
        }
 
-       /*
-        * We don't update the usages for the autofs daemon itself, this
-        * is necessary for recursive autofs mounts
-        */
-       if (!autofs4_oz_mode(sbi))
-               autofs4_update_usage(mnt, dentry);
+       /* Initialize expiry counter after successful mount */
+       if (ino)
+               ino->last_used = jiffies;
 
        spin_lock(&dentry->d_lock);
        dentry->d_flags &= ~DCACHE_AUTOFS_PENDING;
@@ -353,7 +331,7 @@ static int autofs4_revalidate(struct dentry *dentry, struct nameidata *nd)
        /* Pending dentry */
        if (autofs4_ispending(dentry)) {
                if (!oz_mode)
-                       status = try_to_fill_dentry(nd->mnt, dentry, flags);
+                       status = try_to_fill_dentry(dentry, flags);
                return status;
        }
 
@@ -365,20 +343,16 @@ static int autofs4_revalidate(struct dentry *dentry, struct nameidata *nd)
        spin_lock(&dcache_lock);
        if (S_ISDIR(dentry->d_inode->i_mode) &&
            !d_mountpoint(dentry) && 
-           simple_empty_nolock(dentry)) {
+           __simple_empty(dentry)) {
                DPRINTK("dentry=%p %.*s, emptydir",
                         dentry, dentry->d_name.len, dentry->d_name.name);
                spin_unlock(&dcache_lock);
                if (!oz_mode)
-                       status = try_to_fill_dentry(nd->mnt, dentry, flags);
+                       status = try_to_fill_dentry(dentry, flags);
                return status;
        }
        spin_unlock(&dcache_lock);
 
-       /* Update the usage list */
-       if (!oz_mode)
-               autofs4_update_usage(nd->mnt, dentry);
-
        return 1;
 }