Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176604
b: refs/heads/master
c: 213614d
h: refs/heads/master
v: v3
  • Loading branch information
Ian Kent authored and Linus Torvalds committed Dec 16, 2009
1 parent cb444bf commit 8c8f7fa
Show file tree
Hide file tree
Showing 5 changed files with 331 additions and 159 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: cb4b492ac7595aad10756fe0b04691f0965e0cfc
refs/heads/master: 213614d583748d00967a91cacd656f417efb36ce
7 changes: 7 additions & 0 deletions trunk/fs/autofs4/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ do { \
current->pid, __func__, ##args); \
} while (0)

struct rehash_entry {
struct task_struct *task;
struct list_head list;
};

/* Unified info structure. This is pointed to by both the dentry and
inode structures. Each file in the filesystem has an instance of this
structure. It holds a reference to the dentry, so dentries are never
Expand All @@ -76,6 +81,7 @@ struct autofs_info {

struct list_head active;
int active_count;
struct list_head rehash_list;

struct list_head expiring;

Expand All @@ -98,6 +104,7 @@ struct autofs_info {
#define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */
#define AUTOFS_INF_MOUNTPOINT (1<<1) /* mountpoint status for direct expire */
#define AUTOFS_INF_PENDING (1<<2) /* dentry pending mount */
#define AUTOFS_INF_REHASH (1<<3) /* dentry in transit to ->lookup() */

struct autofs_wait_queue {
wait_queue_head_t queue;
Expand Down
6 changes: 5 additions & 1 deletion trunk/fs/autofs4/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ struct dentry *autofs4_expire_direct(struct super_block *sb,
root->d_mounted--;
}
ino->flags |= AUTOFS_INF_EXPIRING;
autofs4_add_expiring(root);
init_completion(&ino->expire_complete);
spin_unlock(&sbi->fs_lock);
return root;
Expand Down Expand Up @@ -406,6 +407,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
expired, (int)expired->d_name.len, expired->d_name.name);
ino = autofs4_dentry_ino(expired);
ino->flags |= AUTOFS_INF_EXPIRING;
autofs4_add_expiring(expired);
init_completion(&ino->expire_complete);
spin_unlock(&sbi->fs_lock);
spin_lock(&dcache_lock);
Expand Down Expand Up @@ -433,7 +435,7 @@ int autofs4_expire_wait(struct dentry *dentry)

DPRINTK("expire done status=%d", status);

if (d_unhashed(dentry))
if (d_unhashed(dentry) && IS_DEADDIR(dentry->d_inode))
return -EAGAIN;

return status;
Expand Down Expand Up @@ -473,6 +475,7 @@ int autofs4_expire_run(struct super_block *sb,
spin_lock(&sbi->fs_lock);
ino = autofs4_dentry_ino(dentry);
ino->flags &= ~AUTOFS_INF_EXPIRING;
autofs4_del_expiring(dentry);
complete_all(&ino->expire_complete);
spin_unlock(&sbi->fs_lock);

Expand Down Expand Up @@ -503,6 +506,7 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
ino->flags &= ~AUTOFS_INF_MOUNTPOINT;
}
ino->flags &= ~AUTOFS_INF_EXPIRING;
autofs4_del_expiring(dentry);
complete_all(&ino->expire_complete);
spin_unlock(&sbi->fs_lock);
dput(dentry);
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/autofs4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino,
ino->dentry = NULL;
ino->size = 0;
INIT_LIST_HEAD(&ino->active);
INIT_LIST_HEAD(&ino->rehash_list);
ino->active_count = 0;
INIT_LIST_HEAD(&ino->expiring);
atomic_set(&ino->count, 0);
Expand Down
Loading

0 comments on commit 8c8f7fa

Please sign in to comment.