diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-22 15:40:57 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-22 18:04:28 -0500 |
commit | 5955102c9984fa081b2d570cfac75c97eecf8f3b (patch) | |
tree | a4744386eac4b916e847eb4eedfada158f6527b4 /fs/devpts | |
parent | 57b8f112cfe6622ddddb8c2641206bb5fa8a112d (diff) |
wrappers for ->i_mutex access
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
inode_foo(inode) being mutex_foo(&inode->i_mutex).
Please, use those for access to ->i_mutex; over the coming cycle
->i_mutex will become rwsem, with ->lookup() done with it held
only shared.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/devpts')
-rw-r--r-- | fs/devpts/inode.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index c35ffdc12bba..1f107fd51328 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c | |||
@@ -255,7 +255,7 @@ static int mknod_ptmx(struct super_block *sb) | |||
255 | if (!uid_valid(root_uid) || !gid_valid(root_gid)) | 255 | if (!uid_valid(root_uid) || !gid_valid(root_gid)) |
256 | return -EINVAL; | 256 | return -EINVAL; |
257 | 257 | ||
258 | mutex_lock(&d_inode(root)->i_mutex); | 258 | inode_lock(d_inode(root)); |
259 | 259 | ||
260 | /* If we have already created ptmx node, return */ | 260 | /* If we have already created ptmx node, return */ |
261 | if (fsi->ptmx_dentry) { | 261 | if (fsi->ptmx_dentry) { |
@@ -292,7 +292,7 @@ static int mknod_ptmx(struct super_block *sb) | |||
292 | fsi->ptmx_dentry = dentry; | 292 | fsi->ptmx_dentry = dentry; |
293 | rc = 0; | 293 | rc = 0; |
294 | out: | 294 | out: |
295 | mutex_unlock(&d_inode(root)->i_mutex); | 295 | inode_unlock(d_inode(root)); |
296 | return rc; | 296 | return rc; |
297 | } | 297 | } |
298 | 298 | ||
@@ -615,7 +615,7 @@ struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, | |||
615 | 615 | ||
616 | sprintf(s, "%d", index); | 616 | sprintf(s, "%d", index); |
617 | 617 | ||
618 | mutex_lock(&d_inode(root)->i_mutex); | 618 | inode_lock(d_inode(root)); |
619 | 619 | ||
620 | dentry = d_alloc_name(root, s); | 620 | dentry = d_alloc_name(root, s); |
621 | if (dentry) { | 621 | if (dentry) { |
@@ -626,7 +626,7 @@ struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, | |||
626 | inode = ERR_PTR(-ENOMEM); | 626 | inode = ERR_PTR(-ENOMEM); |
627 | } | 627 | } |
628 | 628 | ||
629 | mutex_unlock(&d_inode(root)->i_mutex); | 629 | inode_unlock(d_inode(root)); |
630 | 630 | ||
631 | return inode; | 631 | return inode; |
632 | } | 632 | } |
@@ -671,7 +671,7 @@ void devpts_pty_kill(struct inode *inode) | |||
671 | 671 | ||
672 | BUG_ON(inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR)); | 672 | BUG_ON(inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR)); |
673 | 673 | ||
674 | mutex_lock(&d_inode(root)->i_mutex); | 674 | inode_lock(d_inode(root)); |
675 | 675 | ||
676 | dentry = d_find_alias(inode); | 676 | dentry = d_find_alias(inode); |
677 | 677 | ||
@@ -680,7 +680,7 @@ void devpts_pty_kill(struct inode *inode) | |||
680 | dput(dentry); /* d_alloc_name() in devpts_pty_new() */ | 680 | dput(dentry); /* d_alloc_name() in devpts_pty_new() */ |
681 | dput(dentry); /* d_find_alias above */ | 681 | dput(dentry); /* d_find_alias above */ |
682 | 682 | ||
683 | mutex_unlock(&d_inode(root)->i_mutex); | 683 | inode_unlock(d_inode(root)); |
684 | } | 684 | } |
685 | 685 | ||
686 | static int __init init_devpts_fs(void) | 686 | static int __init init_devpts_fs(void) |