]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/autofs4/inode.c
hugetlb: factor out prep_new_huge_page
[linux-2.6-omap-h63xx.git] / fs / autofs4 / inode.c
index 5769a2f9ad60a0f0222eb693ebb576a665cce624..2fdcf5e1d236a7d309283c009ed67ecda6796bcb 100644 (file)
@@ -176,11 +176,16 @@ out_kill_sb:
 static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
 {
        struct autofs_sb_info *sbi = autofs4_sbi(mnt->mnt_sb);
+       struct inode *root_inode = mnt->mnt_sb->s_root->d_inode;
 
        if (!sbi)
                return 0;
 
        seq_printf(m, ",fd=%d", sbi->pipefd);
+       if (root_inode->i_uid != 0)
+               seq_printf(m, ",uid=%u", root_inode->i_uid);
+       if (root_inode->i_gid != 0)
+               seq_printf(m, ",gid=%u", root_inode->i_gid);
        seq_printf(m, ",pgrp=%d", sbi->oz_pgrp);
        seq_printf(m, ",timeout=%lu", sbi->exp_timeout/HZ);
        seq_printf(m, ",minproto=%d", sbi->min_proto);
@@ -218,8 +223,7 @@ static match_table_t tokens = {
 };
 
 static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid,
-                        pid_t *pgrp, unsigned int *type,
-                        int *minproto, int *maxproto)
+               pid_t *pgrp, unsigned int *type, int *minproto, int *maxproto)
 {
        char *p;
        substring_t args[MAX_OPT_ARGS];
@@ -227,7 +231,7 @@ static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid,
 
        *uid = current->uid;
        *gid = current->gid;
-       *pgrp = process_group(current);
+       *pgrp = task_pgrp_nr(current);
 
        *minproto = AUTOFS_MIN_PROTO_VERSION;
        *maxproto = AUTOFS_MAX_PROTO_VERSION;
@@ -313,20 +317,18 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
        struct autofs_sb_info *sbi;
        struct autofs_info *ino;
 
-       sbi = kmalloc(sizeof(*sbi), GFP_KERNEL);
-       if ( !sbi )
+       sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
+       if (!sbi)
                goto fail_unlock;
        DPRINTK("starting up, sbi = %p",sbi);
 
-       memset(sbi, 0, sizeof(*sbi));
-
        s->s_fs_info = sbi;
        sbi->magic = AUTOFS_SBI_MAGIC;
        sbi->pipefd = -1;
        sbi->pipe = NULL;
        sbi->catatonic = 1;
        sbi->exp_timeout = 0;
-       sbi->oz_pgrp = process_group(current);
+       sbi->oz_pgrp = task_pgrp_nr(current);
        sbi->sb = s;
        sbi->version = 0;
        sbi->sub_version = 0;
@@ -363,10 +365,9 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
        root->d_fsdata = ino;
 
        /* Can this call block? */
-       if (parse_options(data, &pipefd,
-                         &root_inode->i_uid, &root_inode->i_gid,
-                         &sbi->oz_pgrp, &sbi->type,
-                         &sbi->min_proto, &sbi->max_proto)) {
+       if (parse_options(data, &pipefd, &root_inode->i_uid, &root_inode->i_gid,
+                               &sbi->oz_pgrp, &sbi->type, &sbi->min_proto,
+                               &sbi->max_proto)) {
                printk("autofs: called with bogus options\n");
                goto fail_dput;
        }
@@ -396,11 +397,11 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
        DPRINTK("pipe fd = %d, pgrp = %u", pipefd, sbi->oz_pgrp);
        pipe = fget(pipefd);
        
-       if ( !pipe ) {
+       if (!pipe) {
                printk("autofs: could not open pipe file descriptor\n");
                goto fail_dput;
        }
-       if ( !pipe->f_op || !pipe->f_op->write )
+       if (!pipe->f_op || !pipe->f_op->write)
                goto fail_fput;
        sbi->pipe = pipe;
        sbi->pipefd = pipefd;