Skip to content

Commit

Permalink
autofs4: kill ->size in autofs_info
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jan 18, 2011
1 parent 09f12c0 commit 0bf71d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions fs/autofs4/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ struct autofs_info {

uid_t uid;
gid_t gid;

size_t size;
};

#define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */
Expand Down
2 changes: 0 additions & 2 deletions fs/autofs4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino,
if (!reinit) {
ino->flags = 0;
ino->dentry = NULL;
ino->size = 0;
INIT_LIST_HEAD(&ino->active);
ino->active_count = 0;
INIT_LIST_HEAD(&ino->expiring);
Expand Down Expand Up @@ -365,7 +364,6 @@ struct inode *autofs4_get_inode(struct super_block *sb,
inode->i_op = &autofs4_dir_inode_operations;
inode->i_fop = &autofs4_dir_operations;
} else if (S_ISLNK(mode)) {
inode->i_size = inf->size;
inode->i_op = &autofs4_symlink_inode_operations;
}

Expand Down
5 changes: 3 additions & 2 deletions fs/autofs4/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 0bf71d4

Please sign in to comment.