aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-03-17 18:26:16 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-15 15:06:56 -0400
commitc5ef60352893b139147b7c033354e8e028e7f52a (patch)
tree879cc48032b12aadef732ca95f79fc759912c984 /net
parenta25b376bded1ba7fd1d455e140d723b7de2e343c (diff)
VFS: net/: d_inode() annotations
socket inodes and sunrpc filesystems - inodes owned by that code Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net')
-rw-r--r--net/socket.c6
-rw-r--r--net/sunrpc/rpc_pipe.c32
2 files changed, 19 insertions, 19 deletions
diff --git a/net/socket.c b/net/socket.c
index 3e33959f3ce5..884e32997698 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -312,7 +312,7 @@ static const struct super_operations sockfs_ops = {
312static char *sockfs_dname(struct dentry *dentry, char *buffer, int buflen) 312static char *sockfs_dname(struct dentry *dentry, char *buffer, int buflen)
313{ 313{
314 return dynamic_dname(dentry, buffer, buflen, "socket:[%lu]", 314 return dynamic_dname(dentry, buffer, buflen, "socket:[%lu]",
315 dentry->d_inode->i_ino); 315 d_inode(dentry)->i_ino);
316} 316}
317 317
318static const struct dentry_operations sockfs_dentry_operations = { 318static const struct dentry_operations sockfs_dentry_operations = {
@@ -375,7 +375,7 @@ struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname)
375 &socket_file_ops); 375 &socket_file_ops);
376 if (unlikely(IS_ERR(file))) { 376 if (unlikely(IS_ERR(file))) {
377 /* drop dentry, keep inode */ 377 /* drop dentry, keep inode */
378 ihold(path.dentry->d_inode); 378 ihold(d_inode(path.dentry));
379 path_put(&path); 379 path_put(&path);
380 return file; 380 return file;
381 } 381 }
@@ -497,7 +497,7 @@ static ssize_t sockfs_listxattr(struct dentry *dentry, char *buffer,
497 ssize_t len; 497 ssize_t len;
498 ssize_t used = 0; 498 ssize_t used = 0;
499 499
500 len = security_inode_listsecurity(dentry->d_inode, buffer, size); 500 len = security_inode_listsecurity(d_inode(dentry), buffer, size);
501 if (len < 0) 501 if (len < 0)
502 return len; 502 return len;
503 used += len; 503 used += len;
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 2d12b76b5a64..d81186d34558 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -94,7 +94,7 @@ rpc_timeout_upcall_queue(struct work_struct *work)
94 } 94 }
95 dentry = dget(pipe->dentry); 95 dentry = dget(pipe->dentry);
96 spin_unlock(&pipe->lock); 96 spin_unlock(&pipe->lock);
97 rpc_purge_list(dentry ? &RPC_I(dentry->d_inode)->waitq : NULL, 97 rpc_purge_list(dentry ? &RPC_I(d_inode(dentry))->waitq : NULL,
98 &free_list, destroy_msg, -ETIMEDOUT); 98 &free_list, destroy_msg, -ETIMEDOUT);
99 dput(dentry); 99 dput(dentry);
100} 100}
@@ -152,7 +152,7 @@ rpc_queue_upcall(struct rpc_pipe *pipe, struct rpc_pipe_msg *msg)
152 dentry = dget(pipe->dentry); 152 dentry = dget(pipe->dentry);
153 spin_unlock(&pipe->lock); 153 spin_unlock(&pipe->lock);
154 if (dentry) { 154 if (dentry) {
155 wake_up(&RPC_I(dentry->d_inode)->waitq); 155 wake_up(&RPC_I(d_inode(dentry))->waitq);
156 dput(dentry); 156 dput(dentry);
157 } 157 }
158 return res; 158 return res;
@@ -591,7 +591,7 @@ static int __rpc_mkpipe_dentry(struct inode *dir, struct dentry *dentry,
591 err = __rpc_create_common(dir, dentry, S_IFIFO | mode, i_fop, private); 591 err = __rpc_create_common(dir, dentry, S_IFIFO | mode, i_fop, private);
592 if (err) 592 if (err)
593 return err; 593 return err;
594 rpci = RPC_I(dentry->d_inode); 594 rpci = RPC_I(d_inode(dentry));
595 rpci->private = private; 595 rpci->private = private;
596 rpci->pipe = pipe; 596 rpci->pipe = pipe;
597 fsnotify_create(dir, dentry); 597 fsnotify_create(dir, dentry);
@@ -616,7 +616,7 @@ int rpc_rmdir(struct dentry *dentry)
616 int error; 616 int error;
617 617
618 parent = dget_parent(dentry); 618 parent = dget_parent(dentry);
619 dir = parent->d_inode; 619 dir = d_inode(parent);
620 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); 620 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
621 error = __rpc_rmdir(dir, dentry); 621 error = __rpc_rmdir(dir, dentry);
622 mutex_unlock(&dir->i_mutex); 622 mutex_unlock(&dir->i_mutex);
@@ -638,7 +638,7 @@ static int __rpc_unlink(struct inode *dir, struct dentry *dentry)
638 638
639static int __rpc_rmpipe(struct inode *dir, struct dentry *dentry) 639static int __rpc_rmpipe(struct inode *dir, struct dentry *dentry)
640{ 640{
641 struct inode *inode = dentry->d_inode; 641 struct inode *inode = d_inode(dentry);
642 642
643 rpc_close_pipes(inode); 643 rpc_close_pipes(inode);
644 return __rpc_unlink(dir, dentry); 644 return __rpc_unlink(dir, dentry);
@@ -654,7 +654,7 @@ static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent,
654 if (!dentry) 654 if (!dentry)
655 return ERR_PTR(-ENOMEM); 655 return ERR_PTR(-ENOMEM);
656 } 656 }
657 if (dentry->d_inode == NULL) 657 if (d_really_is_negative(dentry))
658 return dentry; 658 return dentry;
659 dput(dentry); 659 dput(dentry);
660 return ERR_PTR(-EEXIST); 660 return ERR_PTR(-EEXIST);
@@ -667,7 +667,7 @@ static void __rpc_depopulate(struct dentry *parent,
667 const struct rpc_filelist *files, 667 const struct rpc_filelist *files,
668 int start, int eof) 668 int start, int eof)
669{ 669{
670 struct inode *dir = parent->d_inode; 670 struct inode *dir = d_inode(parent);
671 struct dentry *dentry; 671 struct dentry *dentry;
672 struct qstr name; 672 struct qstr name;
673 int i; 673 int i;
@@ -679,9 +679,9 @@ static void __rpc_depopulate(struct dentry *parent,
679 679
680 if (dentry == NULL) 680 if (dentry == NULL)
681 continue; 681 continue;
682 if (dentry->d_inode == NULL) 682 if (d_really_is_negative(dentry))
683 goto next; 683 goto next;
684 switch (dentry->d_inode->i_mode & S_IFMT) { 684 switch (d_inode(dentry)->i_mode & S_IFMT) {
685 default: 685 default:
686 BUG(); 686 BUG();
687 case S_IFREG: 687 case S_IFREG:
@@ -699,7 +699,7 @@ static void rpc_depopulate(struct dentry *parent,
699 const struct rpc_filelist *files, 699 const struct rpc_filelist *files,
700 int start, int eof) 700 int start, int eof)
701{ 701{
702 struct inode *dir = parent->d_inode; 702 struct inode *dir = d_inode(parent);
703 703
704 mutex_lock_nested(&dir->i_mutex, I_MUTEX_CHILD); 704 mutex_lock_nested(&dir->i_mutex, I_MUTEX_CHILD);
705 __rpc_depopulate(parent, files, start, eof); 705 __rpc_depopulate(parent, files, start, eof);
@@ -711,7 +711,7 @@ static int rpc_populate(struct dentry *parent,
711 int start, int eof, 711 int start, int eof,
712 void *private) 712 void *private)
713{ 713{
714 struct inode *dir = parent->d_inode; 714 struct inode *dir = d_inode(parent);
715 struct dentry *dentry; 715 struct dentry *dentry;
716 int i, err; 716 int i, err;
717 717
@@ -754,7 +754,7 @@ static struct dentry *rpc_mkdir_populate(struct dentry *parent,
754 int (*populate)(struct dentry *, void *), void *args_populate) 754 int (*populate)(struct dentry *, void *), void *args_populate)
755{ 755{
756 struct dentry *dentry; 756 struct dentry *dentry;
757 struct inode *dir = parent->d_inode; 757 struct inode *dir = d_inode(parent);
758 int error; 758 int error;
759 759
760 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); 760 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
@@ -787,7 +787,7 @@ static int rpc_rmdir_depopulate(struct dentry *dentry,
787 int error; 787 int error;
788 788
789 parent = dget_parent(dentry); 789 parent = dget_parent(dentry);
790 dir = parent->d_inode; 790 dir = d_inode(parent);
791 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); 791 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
792 if (depopulate != NULL) 792 if (depopulate != NULL)
793 depopulate(dentry); 793 depopulate(dentry);
@@ -819,7 +819,7 @@ struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name,
819 void *private, struct rpc_pipe *pipe) 819 void *private, struct rpc_pipe *pipe)
820{ 820{
821 struct dentry *dentry; 821 struct dentry *dentry;
822 struct inode *dir = parent->d_inode; 822 struct inode *dir = d_inode(parent);
823 umode_t umode = S_IFIFO | S_IRUSR | S_IWUSR; 823 umode_t umode = S_IFIFO | S_IRUSR | S_IWUSR;
824 int err; 824 int err;
825 825
@@ -864,7 +864,7 @@ rpc_unlink(struct dentry *dentry)
864 int error = 0; 864 int error = 0;
865 865
866 parent = dget_parent(dentry); 866 parent = dget_parent(dentry);
867 dir = parent->d_inode; 867 dir = d_inode(parent);
868 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); 868 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
869 error = __rpc_rmpipe(dir, dentry); 869 error = __rpc_rmpipe(dir, dentry);
870 mutex_unlock(&dir->i_mutex); 870 mutex_unlock(&dir->i_mutex);
@@ -1375,7 +1375,7 @@ rpc_gssd_dummy_depopulate(struct dentry *pipe_dentry)
1375 struct dentry *clnt_dir = pipe_dentry->d_parent; 1375 struct dentry *clnt_dir = pipe_dentry->d_parent;
1376 struct dentry *gssd_dir = clnt_dir->d_parent; 1376 struct dentry *gssd_dir = clnt_dir->d_parent;
1377 1377
1378 __rpc_rmpipe(clnt_dir->d_inode, pipe_dentry); 1378 __rpc_rmpipe(d_inode(clnt_dir), pipe_dentry);
1379 __rpc_depopulate(clnt_dir, gssd_dummy_info_file, 0, 1); 1379 __rpc_depopulate(clnt_dir, gssd_dummy_info_file, 0, 1);
1380 __rpc_depopulate(gssd_dir, gssd_dummy_clnt_dir, 0, 1); 1380 __rpc_depopulate(gssd_dir, gssd_dummy_clnt_dir, 0, 1);
1381 dput(pipe_dentry); 1381 dput(pipe_dentry);