diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-16 17:39:15 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-18 01:21:28 -0500 |
commit | 0bf71d4d005176f6b6587ba64a377f9798213f21 (patch) | |
tree | 4814d73e0201e92e7aca19b0a45f64b9a9644698 /fs/autofs4 | |
parent | 09f12c03fa699ce7d030c47add60577138927d4f (diff) |
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 'fs/autofs4')
-rw-r--r-- | fs/autofs4/autofs_i.h | 2 | ||||
-rw-r--r-- | fs/autofs4/inode.c | 2 | ||||
-rw-r--r-- | fs/autofs4/root.c | 5 |
3 files changed, 3 insertions, 6 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index c6d66db67ff1..0925bacb5c3c 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -88,8 +88,6 @@ struct autofs_info { | |||
88 | 88 | ||
89 | uid_t uid; | 89 | uid_t uid; |
90 | gid_t gid; | 90 | gid_t gid; |
91 | |||
92 | size_t size; | ||
93 | }; | 91 | }; |
94 | 92 | ||
95 | #define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */ | 93 | #define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */ |
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 6b6f43f00c46..ac1a99ce820b 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -38,7 +38,6 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino, | |||
38 | if (!reinit) { | 38 | if (!reinit) { |
39 | ino->flags = 0; | 39 | ino->flags = 0; |
40 | ino->dentry = NULL; | 40 | ino->dentry = NULL; |
41 | ino->size = 0; | ||
42 | INIT_LIST_HEAD(&ino->active); | 41 | INIT_LIST_HEAD(&ino->active); |
43 | ino->active_count = 0; | 42 | ino->active_count = 0; |
44 | INIT_LIST_HEAD(&ino->expiring); | 43 | INIT_LIST_HEAD(&ino->expiring); |
@@ -365,7 +364,6 @@ struct inode *autofs4_get_inode(struct super_block *sb, | |||
365 | inode->i_op = &autofs4_dir_inode_operations; | 364 | inode->i_op = &autofs4_dir_inode_operations; |
366 | inode->i_fop = &autofs4_dir_operations; | 365 | inode->i_fop = &autofs4_dir_operations; |
367 | } else if (S_ISLNK(mode)) { | 366 | } else if (S_ISLNK(mode)) { |
368 | inode->i_size = inf->size; | ||
369 | inode->i_op = &autofs4_symlink_inode_operations; | 367 | inode->i_op = &autofs4_symlink_inode_operations; |
370 | } | 368 | } |
371 | 369 | ||
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, | |||
530 | struct autofs_info *ino = autofs4_dentry_ino(dentry); | 530 | struct autofs_info *ino = autofs4_dentry_ino(dentry); |
531 | struct autofs_info *p_ino; | 531 | struct autofs_info *p_ino; |
532 | struct inode *inode; | 532 | struct inode *inode; |
533 | size_t size = strlen(symname); | ||
533 | char *cp; | 534 | char *cp; |
534 | 535 | ||
535 | DPRINTK("%s <- %.*s", symname, | 536 | DPRINTK("%s <- %.*s", symname, |
@@ -544,8 +545,7 @@ static int autofs4_dir_symlink(struct inode *dir, | |||
544 | 545 | ||
545 | autofs4_del_active(dentry); | 546 | autofs4_del_active(dentry); |
546 | 547 | ||
547 | ino->size = strlen(symname); | 548 | cp = kmalloc(size + 1, GFP_KERNEL); |
548 | cp = kmalloc(ino->size + 1, GFP_KERNEL); | ||
549 | if (!cp) { | 549 | if (!cp) { |
550 | if (!dentry->d_fsdata) | 550 | if (!dentry->d_fsdata) |
551 | kfree(ino); | 551 | kfree(ino); |
@@ -562,6 +562,7 @@ static int autofs4_dir_symlink(struct inode *dir, | |||
562 | return -ENOMEM; | 562 | return -ENOMEM; |
563 | } | 563 | } |
564 | inode->i_private = cp; | 564 | inode->i_private = cp; |
565 | inode->i_size = size; | ||
565 | d_add(dentry, inode); | 566 | d_add(dentry, inode); |
566 | 567 | ||
567 | dentry->d_fsdata = ino; | 568 | dentry->d_fsdata = ino; |