Fix some coding-style errors in autofs
PATCH 1/2 Fix some coding-style errors in autofs
From: Sukadev Bhattiprolu <[email protected]>
Subject: [PATCH 1/2] Fix some coding-style errors in autofs
Fix coding style errors (extra spaces, long lines) in autofs and autofs4 files being modified for container/pidspace issues.
--- fs/autofs/inode.c | 29 +++++++++++-------- fs/autofs/root.c | 77 ++++++++++++++++++++++++++--------------------------- fs/autofs4/inode.c | 16 ++++------- fs/autofs4/root.c | 18 ++++++------ 4 files changed, 70 insertions(+), 70 deletions(-)
fs/autofs/inode.c +16 -13
@@ -34,12 +34,12 @@ void autofs_kill_sb(struct super_block *if (!sbi) goto out_kill_sb; -if ( !sbi->catatonic ) +if (!sbi->catatonic)autofs_catatonic_mode (sbi);/* Free wait queues, close pipe */ autofs_hash_nuke (sbi); -for ( n =0 ; n <AUTOFS_MAX_SYMLINKS ; n++ ) { -if (test_bit (n, sbi->symlink_bitmap) ) +for (n =0 ; n <AUTOFS_MAX_SYMLINKS ; n++) { +if (test_bit (n, sbi->symlink_bitmap))kfree (sbi->symlink[n].data); }
@@ -69,7 +69,8 @@ static match_table_t autofs_tokens = { {Opt_err, NULL} }; -static int parse_options (char *options,int *pipefd,uid_t *uid,gid_t *gid,pid_t *pgrp,int *minproto,int *maxproto) +static int parse_options (char *options,int *pipefd,uid_t *uid,gid_t *gid, +pid_t *pgrp,int *minproto,int *maxproto) {char *p;substring_t args[MAX_OPT_ARGS ];
@@ -140,7 +141,7 @@ int autofs_fill_super(struct super_blockint minproto, maxproto; sbi =kzalloc (sizeof (*sbi),GFP_KERNEL ); -if ( !sbi ) +if (!sbi) goto fail_unlock;DPRINTK (("autofs: starting up, sbi = %p\n" ,sbi));
@@ -169,14 +170,16 @@ int autofs_fill_super(struct super_block goto fail_iput;/* Can this call block? - WTF cares? s is locked. */ -if (parse_options (data,&pipefd,&root_inode->i_uid,&root_inode->i_gid,&sbi->oz_pgrp,&minproto,&maxproto) ) { +if (parse_options (data, &pipefd, &root_inode->i_uid, + &root_inode->i_gid, &sbi->oz_pgrp, &minproto, + &maxproto)) {printk ("autofs: called with bogus options\n" ); goto fail_dput; }/* Couldn't this be tested earlier? */ -if ( minproto >AUTOFS_PROTO_VERSION || - maxproto <AUTOFS_PROTO_VERSION ) { +if (minproto >AUTOFS_PROTO_VERSION || + maxproto <AUTOFS_PROTO_VERSION ) {printk ("autofs: kernel does not match daemon version\n" ); goto fail_dput; }
@@ -184,11 +187,11 @@ int autofs_fill_super(struct super_blockDPRINTK (("autofs: pipe fd = %d, pgrp = %u\n" , 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->catatonic =0 ;
@@ -230,7 +233,7 @@ static void autofs_read_inode(struct ino inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; inode->i_blocks =0 ; -if ( ino ==AUTOFS_ROOT_INO ) { +if (ino ==AUTOFS_ROOT_INO ) { inode->i_mode =S_IFDIR |S_IRUGO |S_IXUGO |S_IWUSR ; inode->i_op = &autofs_root_inode_operations; inode->i_fop = &autofs_root_operations;
@@ -241,12 +244,12 @@ static void autofs_read_inode(struct ino inode->i_uid = inode->i_sb->s_root->d_inode->i_uid; inode->i_gid = inode->i_sb->s_root->d_inode->i_gid; -if ( ino >=AUTOFS_FIRST_SYMLINK && ino <AUTOFS_FIRST_DIR_INO ) { +if (ino >=AUTOFS_FIRST_SYMLINK && ino <AUTOFS_FIRST_DIR_INO ) {/* Symlink inode - should be in symlink list */ struct autofs_symlink *sl; n = ino -AUTOFS_FIRST_SYMLINK ; -if ( n >=AUTOFS_MAX_SYMLINKS || !test_bit (n,sbi->symlink_bitmap)) { +if (n >=AUTOFS_MAX_SYMLINKS || !test_bit (n,sbi->symlink_bitmap)) {printk ("autofs: Looking for bad symlink inode %u\n" , (unsigned int ) ino);return ; }
fs/autofs/root.c +38 -39
255 lines not on this page · raw message
fs/autofs4/inode.c +7 -9
@@ -219,8 +219,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 ];
@@ -315,7 +314,7 @@ int autofs4_fill_super(struct super_blocstruct autofs_info *ino; sbi =kmalloc (sizeof (*sbi),GFP_KERNEL ); -if ( !sbi ) +if (!sbi) goto fail_unlock;DPRINTK ("starting up, sbi = %p" ,sbi);
@@ -364,10 +363,9 @@ int autofs4_fill_super(struct super_bloc 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; }
@@ -397,11 +395,11 @@ int autofs4_fill_super(struct super_blocDPRINTK ("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;
fs/autofs4/root.c +9 -9
@@ -760,7 +760,7 @@ static int autofs4_dir_unlink(struct inostruct autofs_info *p_ino;/* This allows root to remove symlinks */ -if ( !autofs4_oz_mode (sbi) && !capable (CAP_SYS_ADMIN ) ) +if (!autofs4_oz_mode (sbi) && !capable (CAP_SYS_ADMIN ))return -EACCES ;if (atomic_dec_and_test (&ino->count)) {
@@ -834,7 +834,7 @@ static int autofs4_dir_mkdir(struct inodstruct autofs_info *p_ino;struct inode *inode; -if ( !autofs4_oz_mode (sbi) ) +if (!autofs4_oz_mode (sbi))return -EACCES ; DPRINTK("dentry %p, creating %.*s",
@@ -872,11 +872,11 @@ static inline int autofs4_get_set_timeouint rv;unsigned long ntimeout; -if ( (rv =get_user (ntimeout, p)) || - (rv =put_user (sbi->exp_timeout/HZ , p)) ) +if ((rv =get_user (ntimeout, p)) || + (rv =put_user (sbi->exp_timeout/HZ , p)))return rv; -if ( ntimeout >ULONG_MAX /HZ ) +if (ntimeout >ULONG_MAX /HZ ) sbi->exp_timeout =0 ;else sbi->exp_timeout = ntimeout *HZ ;
@@ -907,7 +907,7 @@ static inline int autofs4_ask_reghost(stDPRINTK ("returning %d" , sbi->needs_reghost); status =put_user (sbi->needs_reghost, p); -if ( status ) +if (status)return status; sbi->needs_reghost =0 ;
@@ -976,11 +976,11 @@ static int autofs4_root_ioctl(struct inoDPRINTK ("cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u" , cmd,arg,sbi,process_group (current)); -if (_IOC_TYPE (cmd) !=_IOC_TYPE (AUTOFS_IOC_FIRST ) || -_IOC_NR (cmd) -_IOC_NR (AUTOFS_IOC_FIRST ) >=AUTOFS_IOC_COUNT ) +if (_IOC_TYPE (cmd) !=_IOC_TYPE (AUTOFS_IOC_FIRST ) || +_IOC_NR (cmd) -_IOC_NR (AUTOFS_IOC_FIRST ) >=AUTOFS_IOC_COUNT )return -ENOTTY ; -if ( !autofs4_oz_mode (sbi) && !capable (CAP_SYS_ADMIN ) ) +if (!autofs4_oz_mode (sbi) && !capable (CAP_SYS_ADMIN ))return -EPERM ;switch (cmd) {
Quoted 18 lines · On Mon, 12 Mar 2007 [email protected] wrote:
From: Sukadev Bhattiprolu <[email protected]>
Subject: [PATCH 1/2] Fix some coding-style errors in autofsFix coding style errors (extra spaces, long lines) in autofs and autofs4 files being modified for container/pidspace issues.
--- fs/autofs/inode.c | 29 +++++++++++-------- fs/autofs/root.c | 77 ++++++++++++++++++++++++++--------------------------- fs/autofs4/inode.c | 16 ++++------- fs/autofs4/root.c | 18 ++++++------ 4 files changed, 70 insertions(+), 70 deletions(-)Index:
lx26-20-mm2c/fs/autofs/inode.c
===================================================================
fs/autofs/inode.c void autofs_kill_sb(struct super_block * · line 39
Quoted 8 lines
fs/autofs/inode.c +2
-2@@ -34,12 +34,12 @@ void autofs_kill_sb(struct super_block *autofs_hash_nuke (sbi); -for ( n =0 ; n <AUTOFS_MAX_SYMLINKS ; n++ ) { -if (test_bit (n, sbi->symlink_bitmap) ) +for (n =0 ; n <AUTOFS_MAX_SYMLINKS ; n++) { +if (test_bit (n, sbi->symlink_bitmap))kfree (sbi->symlink[n].data); }
Please do a complete job on the 'for' line by eliminating the space before each semi-colon.
Signature · 1 line
~Randy
Randy.Dunlap [[email protected]] wrote:
| On Mon, 12 Mar 2007 [email protected] wrote: | | Please do a complete job on the 'for' line by eliminating the | space before each semi-colon. | | -- | ~Randy
Ok. Here is the updated patch. The Patch 2/2 in this set should still apply cleanly on top of this.
---
From: Sukadev Bhattiprolu <[email protected]>
Subject: [PATCH 1/2] Fix some coding-style errors in autofs
Fix coding style errors (extra spaces, long lines) in autofs and autofs4 files being modified for container/pidspace issues.
--- fs/autofs/inode.c | 29 +++++++++++-------- fs/autofs/root.c | 77 ++++++++++++++++++++++++++--------------------------- fs/autofs4/inode.c | 16 ++++------- fs/autofs4/root.c | 18 ++++++------ 4 files changed, 70 insertions(+), 70 deletions(-)
fs/autofs/inode.c +16 -13
@@ -34,12 +34,12 @@ void autofs_kill_sb(struct super_block *if (!sbi) goto out_kill_sb; -if ( !sbi->catatonic ) +if (!sbi->catatonic)autofs_catatonic_mode (sbi);/* Free wait queues, close pipe */ autofs_hash_nuke (sbi); -for ( n =0 ; n <AUTOFS_MAX_SYMLINKS ; n++ ) { -if (test_bit (n, sbi->symlink_bitmap) ) +for (n =0 ; n <AUTOFS_MAX_SYMLINKS ; n++) { +if (test_bit (n, sbi->symlink_bitmap))kfree (sbi->symlink[n].data); }
@@ -69,7 +69,8 @@ static match_table_t autofs_tokens = { {Opt_err, NULL} }; -static int parse_options (char *options,int *pipefd,uid_t *uid,gid_t *gid,pid_t *pgrp,int *minproto,int *maxproto) +static int parse_options (char *options,int *pipefd,uid_t *uid,gid_t *gid, +pid_t *pgrp,int *minproto,int *maxproto) {char *p;substring_t args[MAX_OPT_ARGS ];
@@ -140,7 +141,7 @@ int autofs_fill_super(struct super_blockint minproto, maxproto; sbi =kzalloc (sizeof (*sbi),GFP_KERNEL ); -if ( !sbi ) +if (!sbi) goto fail_unlock;DPRINTK (("autofs: starting up, sbi = %p\n" ,sbi));
@@ -169,14 +170,16 @@ int autofs_fill_super(struct super_block goto fail_iput;/* Can this call block? - WTF cares? s is locked. */ -if (parse_options (data,&pipefd,&root_inode->i_uid,&root_inode->i_gid,&sbi->oz_pgrp,&minproto,&maxproto) ) { +if (parse_options (data, &pipefd, &root_inode->i_uid, + &root_inode->i_gid, &sbi->oz_pgrp, &minproto, + &maxproto)) {printk ("autofs: called with bogus options\n" ); goto fail_dput; }/* Couldn't this be tested earlier? */ -if ( minproto >AUTOFS_PROTO_VERSION || - maxproto <AUTOFS_PROTO_VERSION ) { +if (minproto >AUTOFS_PROTO_VERSION || + maxproto <AUTOFS_PROTO_VERSION ) {printk ("autofs: kernel does not match daemon version\n" ); goto fail_dput; }
@@ -184,11 +187,11 @@ int autofs_fill_super(struct super_blockDPRINTK (("autofs: pipe fd = %d, pgrp = %u\n" , 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->catatonic =0 ;
@@ -230,7 +233,7 @@ static void autofs_read_inode(struct ino inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; inode->i_blocks =0 ; -if ( ino ==AUTOFS_ROOT_INO ) { +if (ino ==AUTOFS_ROOT_INO ) { inode->i_mode =S_IFDIR |S_IRUGO |S_IXUGO |S_IWUSR ; inode->i_op = &autofs_root_inode_operations; inode->i_fop = &autofs_root_operations;
@@ -241,12 +244,12 @@ static void autofs_read_inode(struct ino inode->i_uid = inode->i_sb->s_root->d_inode->i_uid; inode->i_gid = inode->i_sb->s_root->d_inode->i_gid; -if ( ino >=AUTOFS_FIRST_SYMLINK && ino <AUTOFS_FIRST_DIR_INO ) { +if (ino >=AUTOFS_FIRST_SYMLINK && ino <AUTOFS_FIRST_DIR_INO ) {/* Symlink inode - should be in symlink list */ struct autofs_symlink *sl; n = ino -AUTOFS_FIRST_SYMLINK ; -if ( n >=AUTOFS_MAX_SYMLINKS || !test_bit (n,sbi->symlink_bitmap)) { +if (n >=AUTOFS_MAX_SYMLINKS || !test_bit (n,sbi->symlink_bitmap)) {printk ("autofs: Looking for bad symlink inode %u\n" , (unsigned int ) ino);return ; }
fs/autofs/root.c +38 -39
255 lines not on this page · raw message
fs/autofs4/inode.c +7 -9
@@ -219,8 +219,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 ];
@@ -315,7 +314,7 @@ int autofs4_fill_super(struct super_blocstruct autofs_info *ino; sbi =kmalloc (sizeof (*sbi),GFP_KERNEL ); -if ( !sbi ) +if (!sbi) goto fail_unlock;DPRINTK ("starting up, sbi = %p" ,sbi);
@@ -364,10 +363,9 @@ int autofs4_fill_super(struct super_bloc 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; }
@@ -397,11 +395,11 @@ int autofs4_fill_super(struct super_blocDPRINTK ("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;
fs/autofs4/root.c +9 -9
@@ -760,7 +760,7 @@ static int autofs4_dir_unlink(struct inostruct autofs_info *p_ino;/* This allows root to remove symlinks */ -if ( !autofs4_oz_mode (sbi) && !capable (CAP_SYS_ADMIN ) ) +if (!autofs4_oz_mode (sbi) && !capable (CAP_SYS_ADMIN ))return -EACCES ;if (atomic_dec_and_test (&ino->count)) {
@@ -834,7 +834,7 @@ static int autofs4_dir_mkdir(struct inodstruct autofs_info *p_ino;struct inode *inode; -if ( !autofs4_oz_mode (sbi) ) +if (!autofs4_oz_mode (sbi))return -EACCES ; DPRINTK("dentry %p, creating %.*s",
@@ -872,11 +872,11 @@ static inline int autofs4_get_set_timeouint rv;unsigned long ntimeout; -if ( (rv =get_user (ntimeout, p)) || - (rv =put_user (sbi->exp_timeout/HZ , p)) ) +if ((rv =get_user (ntimeout, p)) || + (rv =put_user (sbi->exp_timeout/HZ , p)))return rv; -if ( ntimeout >ULONG_MAX /HZ ) +if (ntimeout >ULONG_MAX /HZ ) sbi->exp_timeout =0 ;else sbi->exp_timeout = ntimeout *HZ ;
@@ -907,7 +907,7 @@ static inline int autofs4_ask_reghost(stDPRINTK ("returning %d" , sbi->needs_reghost); status =put_user (sbi->needs_reghost, p); -if ( status ) +if (status)return status; sbi->needs_reghost =0 ;
@@ -976,11 +976,11 @@ static int autofs4_root_ioctl(struct inoDPRINTK ("cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u" , cmd,arg,sbi,process_group (current)); -if (_IOC_TYPE (cmd) !=_IOC_TYPE (AUTOFS_IOC_FIRST ) || -_IOC_NR (cmd) -_IOC_NR (AUTOFS_IOC_FIRST ) >=AUTOFS_IOC_COUNT ) +if (_IOC_TYPE (cmd) !=_IOC_TYPE (AUTOFS_IOC_FIRST ) || +_IOC_NR (cmd) -_IOC_NR (AUTOFS_IOC_FIRST ) >=AUTOFS_IOC_COUNT )return -ENOTTY ; -if ( !autofs4_oz_mode (sbi) && !capable (CAP_SYS_ADMIN ) ) +if (!autofs4_oz_mode (sbi) && !capable (CAP_SYS_ADMIN ))return -EPERM ;switch (cmd) {