X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fautofs4%2Finode.c;h=3b8e34a7aeb1385f689132b20fba34a1046322f6;hb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;hp=649c3dfd108a1442d5a36fc0a906fbf7dad6861d;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 649c3dfd1..3b8e34a7a 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c @@ -87,7 +87,7 @@ static void autofs4_put_super(struct super_block *sb) kfree(sbi); - DPRINTK(("autofs: shutting down\n")); + DPRINTK("shutting down"); } static struct super_operations autofs4_sops = { @@ -187,12 +187,13 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) struct file * pipe; int pipefd; struct autofs_sb_info *sbi; + struct autofs_info *ino; int minproto, maxproto; sbi = (struct autofs_sb_info *) kmalloc(sizeof(*sbi), GFP_KERNEL); if ( !sbi ) goto fail_unlock; - DPRINTK(("autofs: starting up, sbi = %p\n",sbi)); + DPRINTK("starting up, sbi = %p",sbi); memset(sbi, 0, sizeof(*sbi)); @@ -203,6 +204,8 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) sbi->oz_pgrp = process_group(current); sbi->sb = s; sbi->version = 0; + sbi->sub_version = 0; + init_MUTEX(&sbi->wq_sem); sbi->queues = NULL; s->s_blocksize = 1024; s->s_blocksize_bits = 10; @@ -212,7 +215,11 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) /* * Get the root inode and dentry, but defer checking for errors. */ - root_inode = autofs4_get_inode(s, autofs4_mkroot(sbi)); + ino = autofs4_mkroot(sbi); + if (!ino) + goto fail_free; + root_inode = autofs4_get_inode(s, ino); + kfree(ino); if (!root_inode) goto fail_free; @@ -244,8 +251,9 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) } sbi->version = maxproto > AUTOFS_MAX_PROTO_VERSION ? AUTOFS_MAX_PROTO_VERSION : maxproto; + sbi->sub_version = AUTOFS_PROTO_SUBVERSION; - DPRINTK(("autofs: pipe fd = %d, pgrp = %u\n", pipefd, sbi->oz_pgrp)); + DPRINTK("pipe fd = %d, pgrp = %u", pipefd, sbi->oz_pgrp); pipe = fget(pipefd); if ( !pipe ) { @@ -305,7 +313,7 @@ struct inode *autofs4_get_inode(struct super_block *sb, if (S_ISDIR(inf->mode)) { inode->i_nlink = 2; inode->i_op = &autofs4_dir_inode_operations; - inode->i_fop = &simple_dir_operations; + inode->i_fop = &autofs4_dir_operations; } else if (S_ISLNK(inf->mode)) { inode->i_size = inf->size; inode->i_op = &autofs4_symlink_inode_operations;