diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-16 18:43:40 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-18 01:21:28 -0500 |
commit | 26e6c910670171410577c7df2aebe94cef76e150 (patch) | |
tree | 407ecb012b91efce80be76f0191b2efc43689b7f /fs/autofs4/inode.c | |
parent | 5a37db302e698a83209eff22ca8f3fd05eb1d84b (diff) |
autofs4: split autofs4_init_ino()
split init_ino into new_ino and clean_ino; the former is
what used to be init_ino(NULL, sbi), the latter is for cases
where we passed non-NULL ino. Lose unused arguments.
Acked-by: Ian Kent <raven@themaw.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/autofs4/inode.c')
-rw-r--r-- | fs/autofs4/inode.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index b3f9477c9745..0df0c7c46fa2 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -22,35 +22,23 @@ | |||
22 | #include "autofs_i.h" | 22 | #include "autofs_i.h" |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | 24 | ||
25 | struct autofs_info *autofs4_init_ino(struct autofs_info *ino, | 25 | struct autofs_info *autofs4_new_ino(struct autofs_sb_info *sbi) |
26 | struct autofs_sb_info *sbi) | ||
27 | { | 26 | { |
28 | int reinit = 1; | 27 | struct autofs_info *ino = kzalloc(sizeof(*ino), GFP_KERNEL); |
29 | 28 | if (ino) { | |
30 | if (ino == NULL) { | ||
31 | reinit = 0; | ||
32 | ino = kmalloc(sizeof(*ino), GFP_KERNEL); | ||
33 | } | ||
34 | |||
35 | if (ino == NULL) | ||
36 | return NULL; | ||
37 | |||
38 | if (!reinit) { | ||
39 | ino->flags = 0; | ||
40 | ino->dentry = NULL; | ||
41 | INIT_LIST_HEAD(&ino->active); | 29 | INIT_LIST_HEAD(&ino->active); |
42 | ino->active_count = 0; | ||
43 | INIT_LIST_HEAD(&ino->expiring); | 30 | INIT_LIST_HEAD(&ino->expiring); |
44 | atomic_set(&ino->count, 0); | 31 | ino->last_used = jiffies; |
32 | ino->sbi = sbi; | ||
45 | } | 33 | } |
34 | return ino; | ||
35 | } | ||
46 | 36 | ||
37 | void autofs4_clean_ino(struct autofs_info *ino) | ||
38 | { | ||
47 | ino->uid = 0; | 39 | ino->uid = 0; |
48 | ino->gid = 0; | 40 | ino->gid = 0; |
49 | ino->last_used = jiffies; | 41 | ino->last_used = jiffies; |
50 | |||
51 | ino->sbi = sbi; | ||
52 | |||
53 | return ino; | ||
54 | } | 42 | } |
55 | 43 | ||
56 | void autofs4_free_ino(struct autofs_info *ino) | 44 | void autofs4_free_ino(struct autofs_info *ino) |
@@ -256,7 +244,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) | |||
256 | /* | 244 | /* |
257 | * Get the root inode and dentry, but defer checking for errors. | 245 | * Get the root inode and dentry, but defer checking for errors. |
258 | */ | 246 | */ |
259 | ino = autofs4_init_ino(NULL, sbi); | 247 | ino = autofs4_new_ino(sbi); |
260 | if (!ino) | 248 | if (!ino) |
261 | goto fail_free; | 249 | goto fail_free; |
262 | root_inode = autofs4_get_inode(s, S_IFDIR | 0755); | 250 | root_inode = autofs4_get_inode(s, S_IFDIR | 0755); |