Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24248
b: refs/heads/master
c: 862b110
h: refs/heads/master
v: v3
  • Loading branch information
Ian Kent authored and Linus Torvalds committed Mar 27, 2006
1 parent ce766ee commit 73ac74a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e0a7aae94030b878601eb67686b696de4a3764f0
refs/heads/master: 862b110f0132401e422783bf68521ade3dc67578
38 changes: 4 additions & 34 deletions trunk/fs/autofs4/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -246,10 +228,9 @@ static int autofs4_dir_readdir(struct file *file, void *dirent, filldir_t filldi
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;

Expand Down Expand Up @@ -323,13 +304,6 @@ 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;
Expand Down Expand Up @@ -357,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;
}

Expand All @@ -374,15 +348,11 @@ static int autofs4_revalidate(struct dentry *dentry, struct nameidata *nd)
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;
}

Expand Down

0 comments on commit 73ac74a

Please sign in to comment.