diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-17 00:47:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-18 01:21:27 -0500 |
commit | 292c5ee802e9b969b84ee671a5e3001d94230f5b (patch) | |
tree | 616b0a583d17c50aedbb87082943248333d63c2b /fs/autofs4/inode.c | |
parent | c0bcc9d55252012805300ca01b9b7a143b4daf85 (diff) |
autofs4: keep symlink body in inode->i_private
gets rid of all ->free()/->u.symlink machinery in autofs; we simply
keep symlink bodies in inode->i_private and free them in ->evict_inode().
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 | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 9e1a9dad23e1..cf8abc793d50 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -22,14 +22,6 @@ | |||
22 | #include "autofs_i.h" | 22 | #include "autofs_i.h" |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | 24 | ||
25 | static void ino_lnkfree(struct autofs_info *ino) | ||
26 | { | ||
27 | if (ino->u.symlink) { | ||
28 | kfree(ino->u.symlink); | ||
29 | ino->u.symlink = NULL; | ||
30 | } | ||
31 | } | ||
32 | |||
33 | struct autofs_info *autofs4_init_ino(struct autofs_info *ino, | 25 | struct autofs_info *autofs4_init_ino(struct autofs_info *ino, |
34 | struct autofs_sb_info *sbi, mode_t mode) | 26 | struct autofs_sb_info *sbi, mode_t mode) |
35 | { | 27 | { |
@@ -60,16 +52,6 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino, | |||
60 | 52 | ||
61 | ino->sbi = sbi; | 53 | ino->sbi = sbi; |
62 | 54 | ||
63 | if (reinit && ino->free) | ||
64 | (ino->free)(ino); | ||
65 | |||
66 | memset(&ino->u, 0, sizeof(ino->u)); | ||
67 | |||
68 | ino->free = NULL; | ||
69 | |||
70 | if (S_ISLNK(mode)) | ||
71 | ino->free = ino_lnkfree; | ||
72 | |||
73 | return ino; | 55 | return ino; |
74 | } | 56 | } |
75 | 57 | ||
@@ -79,8 +61,6 @@ void autofs4_free_ino(struct autofs_info *ino) | |||
79 | ino->dentry->d_fsdata = NULL; | 61 | ino->dentry->d_fsdata = NULL; |
80 | ino->dentry = NULL; | 62 | ino->dentry = NULL; |
81 | } | 63 | } |
82 | if (ino->free) | ||
83 | (ino->free)(ino); | ||
84 | kfree(ino); | 64 | kfree(ino); |
85 | } | 65 | } |
86 | 66 | ||
@@ -136,9 +116,16 @@ static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt) | |||
136 | return 0; | 116 | return 0; |
137 | } | 117 | } |
138 | 118 | ||
119 | static void autofs4_evict_inode(struct inode *inode) | ||
120 | { | ||
121 | end_writeback(inode); | ||
122 | kfree(inode->i_private); | ||
123 | } | ||
124 | |||
139 | static const struct super_operations autofs4_sops = { | 125 | static const struct super_operations autofs4_sops = { |
140 | .statfs = simple_statfs, | 126 | .statfs = simple_statfs, |
141 | .show_options = autofs4_show_options, | 127 | .show_options = autofs4_show_options, |
128 | .evict_inode = autofs4_evict_inode, | ||
142 | }; | 129 | }; |
143 | 130 | ||
144 | enum {Opt_err, Opt_fd, Opt_uid, Opt_gid, Opt_pgrp, Opt_minproto, Opt_maxproto, | 131 | enum {Opt_err, Opt_fd, Opt_uid, Opt_gid, Opt_pgrp, Opt_minproto, Opt_maxproto, |