Commit 835aa440 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

devpts: Coding style clean up

Just nail the oddments now while this code is being touched
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 784c4d8b
...@@ -311,7 +311,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent) ...@@ -311,7 +311,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
if (s->s_root) if (s->s_root)
return 0; return 0;
printk("devpts: get root dentry failed\n"); printk(KERN_ERR "devpts: get root dentry failed\n");
iput(inode); iput(inode);
free_fsi: free_fsi:
...@@ -444,25 +444,25 @@ static int is_new_instance_mount(void *data) ...@@ -444,25 +444,25 @@ static int is_new_instance_mount(void *data)
static int get_init_pts_sb(struct file_system_type *fs_type, int flags, static int get_init_pts_sb(struct file_system_type *fs_type, int flags,
void *data, struct vfsmount *mnt) void *data, struct vfsmount *mnt)
{ {
struct super_block *s; struct super_block *s;
int error; int error;
s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL); s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
if (IS_ERR(s)) if (IS_ERR(s))
return PTR_ERR(s); return PTR_ERR(s);
if (!s->s_root) { if (!s->s_root) {
s->s_flags = flags; s->s_flags = flags;
error = devpts_fill_super(s, data, flags & MS_SILENT ? 1 : 0); error = devpts_fill_super(s, data, flags & MS_SILENT ? 1 : 0);
if (error) { if (error) {
up_write(&s->s_umount); up_write(&s->s_umount);
deactivate_super(s); deactivate_super(s);
return error; return error;
} }
s->s_flags |= MS_ACTIVE; s->s_flags |= MS_ACTIVE;
} }
do_remount_sb(s, flags, data, 0); do_remount_sb(s, flags, data, 0);
return simple_set_mnt(mnt, s); return simple_set_mnt(mnt, s);
} }
/* /*
...@@ -477,7 +477,7 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags, ...@@ -477,7 +477,7 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags,
err = get_init_pts_sb(fs_type, flags, data, mnt); err = get_init_pts_sb(fs_type, flags, data, mnt);
if (err) if (err)
return err; return err;
err = mknod_ptmx(mnt->mnt_sb); err = mknod_ptmx(mnt->mnt_sb);
if (err) { if (err) {
...@@ -542,9 +542,8 @@ int devpts_new_index(struct inode *ptmx_inode) ...@@ -542,9 +542,8 @@ int devpts_new_index(struct inode *ptmx_inode)
int ida_ret; int ida_ret;
retry: retry:
if (!ida_pre_get(&fsi->allocated_ptys, GFP_KERNEL)) { if (!ida_pre_get(&fsi->allocated_ptys, GFP_KERNEL))
return -ENOMEM; return -ENOMEM;
}
mutex_lock(&allocated_ptys_lock); mutex_lock(&allocated_ptys_lock);
ida_ret = ida_get_new(&fsi->allocated_ptys, &index); ida_ret = ida_get_new(&fsi->allocated_ptys, &index);
...@@ -576,7 +575,8 @@ void devpts_kill_index(struct inode *ptmx_inode, int idx) ...@@ -576,7 +575,8 @@ void devpts_kill_index(struct inode *ptmx_inode, int idx)
int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty) int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
{ {
int number = tty->index; /* tty layer puts index from devpts_new_index() in here */ /* tty layer puts index from devpts_new_index() in here */
int number = tty->index;
struct tty_driver *driver = tty->driver; struct tty_driver *driver = tty->driver;
dev_t device = MKDEV(driver->major, driver->minor_start+number); dev_t device = MKDEV(driver->major, driver->minor_start+number);
struct dentry *dentry; struct dentry *dentry;
...@@ -644,11 +644,10 @@ void devpts_pty_kill(struct tty_struct *tty) ...@@ -644,11 +644,10 @@ void devpts_pty_kill(struct tty_struct *tty)
if (dentry) { if (dentry) {
inode->i_nlink--; inode->i_nlink--;
d_delete(dentry); d_delete(dentry);
dput(dentry); // d_alloc_name() in devpts_pty_new() dput(dentry); /* d_alloc_name() in devpts_pty_new() */
} }
dput(dentry); // d_find_alias above dput(dentry); /* d_find_alias above */
out: out:
mutex_unlock(&root->d_inode->i_mutex); mutex_unlock(&root->d_inode->i_mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment