Commit 0bf71d4d005176f6b6587ba64a377f9798213f21

Authored by Al Viro
1 parent 09f12c03fa

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>

Showing 3 changed files with 3 additions and 6 deletions Side-by-side Diff

fs/autofs4/autofs_i.h
... ... @@ -88,8 +88,6 @@
88 88  
89 89 uid_t uid;
90 90 gid_t gid;
91   -
92   - size_t size;
93 91 };
94 92  
95 93 #define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */
... ... @@ -38,7 +38,6 @@
38 38 if (!reinit) {
39 39 ino->flags = 0;
40 40 ino->dentry = NULL;
41   - ino->size = 0;
42 41 INIT_LIST_HEAD(&ino->active);
43 42 ino->active_count = 0;
44 43 INIT_LIST_HEAD(&ino->expiring);
... ... @@ -365,7 +364,6 @@
365 364 inode->i_op = &autofs4_dir_inode_operations;
366 365 inode->i_fop = &autofs4_dir_operations;
367 366 } else if (S_ISLNK(mode)) {
368   - inode->i_size = inf->size;
369 367 inode->i_op = &autofs4_symlink_inode_operations;
370 368 }
371 369  
... ... @@ -530,6 +530,7 @@
530 530 struct autofs_info *ino = autofs4_dentry_ino(dentry);
531 531 struct autofs_info *p_ino;
532 532 struct inode *inode;
  533 + size_t size = strlen(symname);
533 534 char *cp;
534 535  
535 536 DPRINTK("%s <- %.*s", symname,
... ... @@ -544,8 +545,7 @@
544 545  
545 546 autofs4_del_active(dentry);
546 547  
547   - ino->size = strlen(symname);
548   - cp = kmalloc(ino->size + 1, GFP_KERNEL);
  548 + cp = kmalloc(size + 1, GFP_KERNEL);
549 549 if (!cp) {
550 550 if (!dentry->d_fsdata)
551 551 kfree(ino);
... ... @@ -562,6 +562,7 @@
562 562 return -ENOMEM;
563 563 }
564 564 inode->i_private = cp;
  565 + inode->i_size = size;
565 566 d_add(dentry, inode);
566 567  
567 568 dentry->d_fsdata = ino;