aboutsummaryrefslogtreecommitdiffstats
path: root/fs/devpts
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2009-01-02 08:42:48 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 13:19:36 -0500
commit835aa440f1c3fe16a622015bc1b52dffedf6d90e (patch)
treed0ba2b840bafde5e149baca2990030fe30e8240e /fs/devpts
parent784c4d8b1b1e66f8c45e8b889613f4982f525b2b (diff)
devpts: Coding style clean up
Just nail the oddments now while this code is being touched Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/devpts')
-rw-r--r--fs/devpts/inode.c53
1 files changed, 26 insertions, 27 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index b4a89fa21673..b02c24313d5c 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -311,7 +311,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
311 if (s->s_root) 311 if (s->s_root)
312 return 0; 312 return 0;
313 313
314 printk("devpts: get root dentry failed\n"); 314 printk(KERN_ERR "devpts: get root dentry failed\n");
315 iput(inode); 315 iput(inode);
316 316
317free_fsi: 317free_fsi:
@@ -444,25 +444,25 @@ static int is_new_instance_mount(void *data)
444static int get_init_pts_sb(struct file_system_type *fs_type, int flags, 444static int get_init_pts_sb(struct file_system_type *fs_type, int flags,
445 void *data, struct vfsmount *mnt) 445 void *data, struct vfsmount *mnt)
446{ 446{
447 struct super_block *s; 447 struct super_block *s;
448 int error; 448 int error;
449 449
450 s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL); 450 s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
451 if (IS_ERR(s)) 451 if (IS_ERR(s))
452 return PTR_ERR(s); 452 return PTR_ERR(s);
453 453
454 if (!s->s_root) { 454 if (!s->s_root) {
455 s->s_flags = flags; 455 s->s_flags = flags;
456 error = devpts_fill_super(s, data, flags & MS_SILENT ? 1 : 0); 456 error = devpts_fill_super(s, data, flags & MS_SILENT ? 1 : 0);
457 if (error) { 457 if (error) {
458 up_write(&s->s_umount); 458 up_write(&s->s_umount);
459 deactivate_super(s); 459 deactivate_super(s);
460 return error; 460 return error;
461 } 461 }
462 s->s_flags |= MS_ACTIVE; 462 s->s_flags |= MS_ACTIVE;
463 } 463 }
464 do_remount_sb(s, flags, data, 0); 464 do_remount_sb(s, flags, data, 0);
465 return simple_set_mnt(mnt, s); 465 return simple_set_mnt(mnt, s);
466} 466}
467 467
468/* 468/*
@@ -477,7 +477,7 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags,
477 477
478 err = get_init_pts_sb(fs_type, flags, data, mnt); 478 err = get_init_pts_sb(fs_type, flags, data, mnt);
479 if (err) 479 if (err)
480 return err; 480 return err;
481 481
482 err = mknod_ptmx(mnt->mnt_sb); 482 err = mknod_ptmx(mnt->mnt_sb);
483 if (err) { 483 if (err) {
@@ -542,9 +542,8 @@ int devpts_new_index(struct inode *ptmx_inode)
542 int ida_ret; 542 int ida_ret;
543 543
544retry: 544retry:
545 if (!ida_pre_get(&fsi->allocated_ptys, GFP_KERNEL)) { 545 if (!ida_pre_get(&fsi->allocated_ptys, GFP_KERNEL))
546 return -ENOMEM; 546 return -ENOMEM;
547 }
548 547
549 mutex_lock(&allocated_ptys_lock); 548 mutex_lock(&allocated_ptys_lock);
550 ida_ret = ida_get_new(&fsi->allocated_ptys, &index); 549 ida_ret = ida_get_new(&fsi->allocated_ptys, &index);
@@ -576,7 +575,8 @@ void devpts_kill_index(struct inode *ptmx_inode, int idx)
576 575
577int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty) 576int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
578{ 577{
579 int number = tty->index; /* tty layer puts index from devpts_new_index() in here */ 578 /* tty layer puts index from devpts_new_index() in here */
579 int number = tty->index;
580 struct tty_driver *driver = tty->driver; 580 struct tty_driver *driver = tty->driver;
581 dev_t device = MKDEV(driver->major, driver->minor_start+number); 581 dev_t device = MKDEV(driver->major, driver->minor_start+number);
582 struct dentry *dentry; 582 struct dentry *dentry;
@@ -644,11 +644,10 @@ void devpts_pty_kill(struct tty_struct *tty)
644 if (dentry) { 644 if (dentry) {
645 inode->i_nlink--; 645 inode->i_nlink--;
646 d_delete(dentry); 646 d_delete(dentry);
647 dput(dentry); // d_alloc_name() in devpts_pty_new() 647 dput(dentry); /* d_alloc_name() in devpts_pty_new() */
648 } 648 }
649 649
650 dput(dentry); // d_find_alias above 650 dput(dentry); /* d_find_alias above */
651
652out: 651out:
653 mutex_unlock(&root->d_inode->i_mutex); 652 mutex_unlock(&root->d_inode->i_mutex);
654} 653}