summaryrefslogtreecommitdiffstats
path: root/ipc/mqueue.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-03-17 18:26:12 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-15 15:06:58 -0400
commit75c3cfa855dcedc84e7964269c9b6baf26137959 (patch)
tree2ef6b8570069d7811542db376c88fbe208a5771d /ipc/mqueue.c
parent2b0143b5c986be1ce8408b3aadc4709e0a94429d (diff)
VFS: assorted weird filesystems: d_inode() annotations
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r--ipc/mqueue.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 7635a1cf99f3..3aaea7ffd077 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -466,7 +466,7 @@ out_unlock:
466 466
467static int mqueue_unlink(struct inode *dir, struct dentry *dentry) 467static int mqueue_unlink(struct inode *dir, struct dentry *dentry)
468{ 468{
469 struct inode *inode = dentry->d_inode; 469 struct inode *inode = d_inode(dentry);
470 470
471 dir->i_ctime = dir->i_mtime = dir->i_atime = CURRENT_TIME; 471 dir->i_ctime = dir->i_mtime = dir->i_atime = CURRENT_TIME;
472 dir->i_size -= DIRENT_SIZE; 472 dir->i_size -= DIRENT_SIZE;
@@ -770,7 +770,7 @@ static struct file *do_open(struct path *path, int oflag)
770 if ((oflag & O_ACCMODE) == (O_RDWR | O_WRONLY)) 770 if ((oflag & O_ACCMODE) == (O_RDWR | O_WRONLY))
771 return ERR_PTR(-EINVAL); 771 return ERR_PTR(-EINVAL);
772 acc = oflag2acc[oflag & O_ACCMODE]; 772 acc = oflag2acc[oflag & O_ACCMODE];
773 if (inode_permission(path->dentry->d_inode, acc)) 773 if (inode_permission(d_inode(path->dentry), acc))
774 return ERR_PTR(-EACCES); 774 return ERR_PTR(-EACCES);
775 return dentry_open(path, oflag, current_cred()); 775 return dentry_open(path, oflag, current_cred());
776} 776}
@@ -802,7 +802,7 @@ SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, umode_t, mode,
802 802
803 ro = mnt_want_write(mnt); /* we'll drop it in any case */ 803 ro = mnt_want_write(mnt); /* we'll drop it in any case */
804 error = 0; 804 error = 0;
805 mutex_lock(&root->d_inode->i_mutex); 805 mutex_lock(&d_inode(root)->i_mutex);
806 path.dentry = lookup_one_len(name->name, root, strlen(name->name)); 806 path.dentry = lookup_one_len(name->name, root, strlen(name->name));
807 if (IS_ERR(path.dentry)) { 807 if (IS_ERR(path.dentry)) {
808 error = PTR_ERR(path.dentry); 808 error = PTR_ERR(path.dentry);
@@ -811,7 +811,7 @@ SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, umode_t, mode,
811 path.mnt = mntget(mnt); 811 path.mnt = mntget(mnt);
812 812
813 if (oflag & O_CREAT) { 813 if (oflag & O_CREAT) {
814 if (path.dentry->d_inode) { /* entry already exists */ 814 if (d_really_is_positive(path.dentry)) { /* entry already exists */
815 audit_inode(name, path.dentry, 0); 815 audit_inode(name, path.dentry, 0);
816 if (oflag & O_EXCL) { 816 if (oflag & O_EXCL) {
817 error = -EEXIST; 817 error = -EEXIST;
@@ -824,12 +824,12 @@ SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, umode_t, mode,
824 goto out; 824 goto out;
825 } 825 }
826 audit_inode_parent_hidden(name, root); 826 audit_inode_parent_hidden(name, root);
827 filp = do_create(ipc_ns, root->d_inode, 827 filp = do_create(ipc_ns, d_inode(root),
828 &path, oflag, mode, 828 &path, oflag, mode,
829 u_attr ? &attr : NULL); 829 u_attr ? &attr : NULL);
830 } 830 }
831 } else { 831 } else {
832 if (!path.dentry->d_inode) { 832 if (d_really_is_negative(path.dentry)) {
833 error = -ENOENT; 833 error = -ENOENT;
834 goto out; 834 goto out;
835 } 835 }
@@ -848,7 +848,7 @@ out_putfd:
848 put_unused_fd(fd); 848 put_unused_fd(fd);
849 fd = error; 849 fd = error;
850 } 850 }
851 mutex_unlock(&root->d_inode->i_mutex); 851 mutex_unlock(&d_inode(root)->i_mutex);
852 if (!ro) 852 if (!ro)
853 mnt_drop_write(mnt); 853 mnt_drop_write(mnt);
854out_putname: 854out_putname:
@@ -873,7 +873,7 @@ SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name)
873 err = mnt_want_write(mnt); 873 err = mnt_want_write(mnt);
874 if (err) 874 if (err)
875 goto out_name; 875 goto out_name;
876 mutex_lock_nested(&mnt->mnt_root->d_inode->i_mutex, I_MUTEX_PARENT); 876 mutex_lock_nested(&d_inode(mnt->mnt_root)->i_mutex, I_MUTEX_PARENT);
877 dentry = lookup_one_len(name->name, mnt->mnt_root, 877 dentry = lookup_one_len(name->name, mnt->mnt_root,
878 strlen(name->name)); 878 strlen(name->name));
879 if (IS_ERR(dentry)) { 879 if (IS_ERR(dentry)) {
@@ -881,17 +881,17 @@ SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name)
881 goto out_unlock; 881 goto out_unlock;
882 } 882 }
883 883
884 inode = dentry->d_inode; 884 inode = d_inode(dentry);
885 if (!inode) { 885 if (!inode) {
886 err = -ENOENT; 886 err = -ENOENT;
887 } else { 887 } else {
888 ihold(inode); 888 ihold(inode);
889 err = vfs_unlink(dentry->d_parent->d_inode, dentry, NULL); 889 err = vfs_unlink(d_inode(dentry->d_parent), dentry, NULL);
890 } 890 }
891 dput(dentry); 891 dput(dentry);
892 892
893out_unlock: 893out_unlock:
894 mutex_unlock(&mnt->mnt_root->d_inode->i_mutex); 894 mutex_unlock(&d_inode(mnt->mnt_root)->i_mutex);
895 if (inode) 895 if (inode)
896 iput(inode); 896 iput(inode);
897 mnt_drop_write(mnt); 897 mnt_drop_write(mnt);