Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231785
b: refs/heads/master
c: 292c5ee
h: refs/heads/master
i:
  231783: 7902c1d
v: v3
  • Loading branch information
Al Viro committed Jan 18, 2011
1 parent df42f0b commit f6218ef
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0bcc9d55252012805300ca01b9b7a143b4daf85
refs/heads/master: 292c5ee802e9b969b84ee671a5e3001d94230f5b
5 changes: 0 additions & 5 deletions trunk/fs/autofs4/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ struct autofs_info {

mode_t mode;
size_t size;

void (*free)(struct autofs_info *);
union {
const char *symlink;
} u;
};

#define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */
Expand Down
27 changes: 7 additions & 20 deletions trunk/fs/autofs4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
#include "autofs_i.h"
#include <linux/module.h>

static void ino_lnkfree(struct autofs_info *ino)
{
if (ino->u.symlink) {
kfree(ino->u.symlink);
ino->u.symlink = NULL;
}
}

struct autofs_info *autofs4_init_ino(struct autofs_info *ino,
struct autofs_sb_info *sbi, mode_t mode)
{
Expand Down Expand Up @@ -60,16 +52,6 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino,

ino->sbi = sbi;

if (reinit && ino->free)
(ino->free)(ino);

memset(&ino->u, 0, sizeof(ino->u));

ino->free = NULL;

if (S_ISLNK(mode))
ino->free = ino_lnkfree;

return ino;
}

Expand All @@ -79,8 +61,6 @@ void autofs4_free_ino(struct autofs_info *ino)
ino->dentry->d_fsdata = NULL;
ino->dentry = NULL;
}
if (ino->free)
(ino->free)(ino);
kfree(ino);
}

Expand Down Expand Up @@ -136,9 +116,16 @@ static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
return 0;
}

static void autofs4_evict_inode(struct inode *inode)
{
end_writeback(inode);
kfree(inode->i_private);
}

static const struct super_operations autofs4_sops = {
.statfs = simple_statfs,
.show_options = autofs4_show_options,
.evict_inode = autofs4_evict_inode,
};

enum {Opt_err, Opt_fd, Opt_uid, Opt_gid, Opt_pgrp, Opt_minproto, Opt_maxproto,
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/autofs4/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ static int autofs4_dir_symlink(struct inode *dir,
kfree(ino);
return -ENOMEM;
}
inode->i_private = cp;
d_add(dentry, inode);

dentry->d_fsdata = ino;
Expand All @@ -570,7 +571,6 @@ static int autofs4_dir_symlink(struct inode *dir,
if (p_ino && dentry->d_parent != dentry)
atomic_inc(&p_ino->count);

ino->u.symlink = cp;
dir->i_mtime = CURRENT_TIME;

return 0;
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/autofs4/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
{
struct autofs_info *ino = autofs4_dentry_ino(dentry);
nd_set_link(nd, (char *)ino->u.symlink);
nd_set_link(nd, dentry->d_inode->i_private);
return NULL;
}

Expand Down

0 comments on commit f6218ef

Please sign in to comment.