summaryrefslogtreecommitdiffstats
path: root/fs/autofs4/root.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-01-16 23:39:15 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2011-01-18 07:21:28 +0100
commit0bf71d4d005176f6b6587ba64a377f9798213f21 (patch)
tree4814d73e0201e92e7aca19b0a45f64b9a9644698 /fs/autofs4/root.c
parentautofs4: pass mode to autofs4_get_inode() explicitly (diff)
downloadlinux-0bf71d4d005176f6b6587ba64a377f9798213f21.tar.xz
linux-0bf71d4d005176f6b6587ba64a377f9798213f21.zip
autofs4: kill ->size in autofs_info
It's used only to pass the length of symlink body to autofs4_get_inode() in autofs4_dir_symlink(). We can bloody well set inode->i_size in autofs4_dir_symlink() directly and be done with that. Acked-by: Ian Kent <raven@themaw.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r--fs/autofs4/root.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index e55dcdbeb450..1ad3c6ca9b03 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -530,6 +530,7 @@ static int autofs4_dir_symlink(struct inode *dir,
struct autofs_info *ino = autofs4_dentry_ino(dentry);
struct autofs_info *p_ino;
struct inode *inode;
+ size_t size = strlen(symname);
char *cp;
DPRINTK("%s <- %.*s", symname,
@@ -544,8 +545,7 @@ static int autofs4_dir_symlink(struct inode *dir,
autofs4_del_active(dentry);
- ino->size = strlen(symname);
- cp = kmalloc(ino->size + 1, GFP_KERNEL);
+ cp = kmalloc(size + 1, GFP_KERNEL);
if (!cp) {
if (!dentry->d_fsdata)
kfree(ino);
@@ -562,6 +562,7 @@ static int autofs4_dir_symlink(struct inode *dir,
return -ENOMEM;
}
inode->i_private = cp;
+ inode->i_size = size;
d_add(dentry, inode);
dentry->d_fsdata = ino;