Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231791
b: refs/heads/master
c: 26e6c91
h: refs/heads/master
i:
  231789: af744b8
  231787: d0a3677
  231783: 7902c1d
  231775: 1aa6082
v: v3
  • Loading branch information
Al Viro committed Jan 18, 2011
1 parent f1a0744 commit aa76956
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 27 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: 5a37db302e698a83209eff22ca8f3fd05eb1d84b
refs/heads/master: 26e6c910670171410577c7df2aebe94cef76e150
3 changes: 2 additions & 1 deletion trunk/fs/autofs4/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ static inline void managed_dentry_clear_managed(struct dentry *dentry)
/* Initializing function */

int autofs4_fill_super(struct super_block *, void *, int);
struct autofs_info *autofs4_init_ino(struct autofs_info *, struct autofs_sb_info *sbi);
struct autofs_info *autofs4_new_ino(struct autofs_sb_info *);
void autofs4_clean_ino(struct autofs_info *);

/* Queue management functions */

Expand Down
32 changes: 10 additions & 22 deletions trunk/fs/autofs4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,23 @@
#include "autofs_i.h"
#include <linux/module.h>

struct autofs_info *autofs4_init_ino(struct autofs_info *ino,
struct autofs_sb_info *sbi)
struct autofs_info *autofs4_new_ino(struct autofs_sb_info *sbi)
{
int reinit = 1;

if (ino == NULL) {
reinit = 0;
ino = kmalloc(sizeof(*ino), GFP_KERNEL);
}

if (ino == NULL)
return NULL;

if (!reinit) {
ino->flags = 0;
ino->dentry = NULL;
struct autofs_info *ino = kzalloc(sizeof(*ino), GFP_KERNEL);
if (ino) {
INIT_LIST_HEAD(&ino->active);
ino->active_count = 0;
INIT_LIST_HEAD(&ino->expiring);
atomic_set(&ino->count, 0);
ino->last_used = jiffies;
ino->sbi = sbi;
}
return ino;
}

void autofs4_clean_ino(struct autofs_info *ino)
{
ino->uid = 0;
ino->gid = 0;
ino->last_used = jiffies;

ino->sbi = sbi;

return ino;
}

void autofs4_free_ino(struct autofs_info *ino)
Expand Down Expand Up @@ -256,7 +244,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
/*
* Get the root inode and dentry, but defer checking for errors.
*/
ino = autofs4_init_ino(NULL, sbi);
ino = autofs4_new_ino(sbi);
if (!ino)
goto fail_free;
root_inode = autofs4_get_inode(s, S_IFDIR | 0755);
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/autofs4/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s
if (autofs_type_indirect(sbi->type) && IS_ROOT(dentry->d_parent))
__managed_dentry_set_managed(dentry);

ino = autofs4_init_ino(NULL, sbi);
ino = autofs4_new_ino(sbi);
if (!ino)
return ERR_PTR(-ENOMEM);

Expand Down Expand Up @@ -541,7 +541,7 @@ static int autofs4_dir_symlink(struct inode *dir,

BUG_ON(!ino);

autofs4_init_ino(ino, sbi);
autofs4_clean_ino(ino);

autofs4_del_active(dentry);

Expand Down Expand Up @@ -732,7 +732,7 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode)

BUG_ON(!ino);

autofs4_init_ino(ino, sbi);
autofs4_clean_ino(ino);

autofs4_del_active(dentry);

Expand Down

0 comments on commit aa76956

Please sign in to comment.