uid_t uid;
gid_t gid;
- mode_t mode;
size_t size;
};
return 0;
}
-struct inode *autofs4_get_inode(struct super_block *, struct autofs_info *);
+struct inode *autofs4_get_inode(struct super_block *, struct autofs_info *, mode_t);
void autofs4_free_ino(struct autofs_info *);
/* Expiration */
/* Initializing function */
int autofs4_fill_super(struct super_block *, void *, int);
-struct autofs_info *autofs4_init_ino(struct autofs_info *, struct autofs_sb_info *sbi, mode_t mode);
+struct autofs_info *autofs4_init_ino(struct autofs_info *, struct autofs_sb_info *sbi);
/* Queue management functions */
#include <linux/module.h>
struct autofs_info *autofs4_init_ino(struct autofs_info *ino,
- struct autofs_sb_info *sbi, mode_t mode)
+ struct autofs_sb_info *sbi)
{
int reinit = 1;
ino->uid = 0;
ino->gid = 0;
- ino->mode = mode;
ino->last_used = jiffies;
ino->sbi = sbi;
/*
* Get the root inode and dentry, but defer checking for errors.
*/
- ino = autofs4_init_ino(NULL, sbi, S_IFDIR | 0755);
+ ino = autofs4_init_ino(NULL, sbi);
if (!ino)
goto fail_free;
- root_inode = autofs4_get_inode(s, ino);
+ root_inode = autofs4_get_inode(s, ino, S_IFDIR | 0755);
if (!root_inode)
goto fail_ino;
}
struct inode *autofs4_get_inode(struct super_block *sb,
- struct autofs_info *inf)
+ struct autofs_info *inf,
+ mode_t mode)
{
struct inode *inode = new_inode(sb);
if (inode == NULL)
return NULL;
- inode->i_mode = inf->mode;
+ inode->i_mode = mode;
if (sb->s_root) {
inode->i_uid = sb->s_root->d_inode->i_uid;
inode->i_gid = sb->s_root->d_inode->i_gid;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inode->i_ino = get_next_ino();
- if (S_ISDIR(inf->mode)) {
+ if (S_ISDIR(mode)) {
inode->i_nlink = 2;
inode->i_op = &autofs4_dir_inode_operations;
inode->i_fop = &autofs4_dir_operations;
- } else if (S_ISLNK(inf->mode)) {
+ } else if (S_ISLNK(mode)) {
inode->i_size = inf->size;
inode->i_op = &autofs4_symlink_inode_operations;
}
if (autofs_type_indirect(sbi->type) && IS_ROOT(dentry->d_parent))
__managed_dentry_set_managed(dentry);
- ino = autofs4_init_ino(NULL, sbi, 0555);
+ ino = autofs4_init_ino(NULL, sbi);
if (!ino)
return ERR_PTR(-ENOMEM);
if (!autofs4_oz_mode(sbi))
return -EACCES;
- ino = autofs4_init_ino(ino, sbi, S_IFLNK | 0555);
+ ino = autofs4_init_ino(ino, sbi);
if (!ino)
return -ENOMEM;
strcpy(cp, symname);
- inode = autofs4_get_inode(dir->i_sb, ino);
+ inode = autofs4_get_inode(dir->i_sb, ino, S_IFLNK | 0555);
if (!inode) {
kfree(cp);
if (!dentry->d_fsdata)
DPRINTK("dentry %p, creating %.*s",
dentry, dentry->d_name.len, dentry->d_name.name);
- ino = autofs4_init_ino(ino, sbi, S_IFDIR | 0555);
+ ino = autofs4_init_ino(ino, sbi);
if (!ino)
return -ENOMEM;
autofs4_del_active(dentry);
- inode = autofs4_get_inode(dir->i_sb, ino);
+ inode = autofs4_get_inode(dir->i_sb, ino, S_IFDIR | 0555);
if (!inode) {
if (!dentry->d_fsdata)
kfree(ino);