Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Howells and committed by
Al Viro
c5ef6035 a25b376b

+19 -19
+3 -3
net/socket.c
··· 312 312 static char *sockfs_dname(struct dentry *dentry, char *buffer, int buflen) 313 313 { 314 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 318 318 static const struct dentry_operations sockfs_dentry_operations = { ··· 375 375 &socket_file_ops); 376 376 if (unlikely(IS_ERR(file))) { 377 377 /* drop dentry, keep inode */ 378 - ihold(path.dentry->d_inode); 378 + ihold(d_inode(path.dentry)); 379 379 path_put(&path); 380 380 return file; 381 381 } ··· 497 497 ssize_t len; 498 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 501 if (len < 0) 502 502 return len; 503 503 used += len;
+16 -16
net/sunrpc/rpc_pipe.c
··· 94 94 } 95 95 dentry = dget(pipe->dentry); 96 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 98 &free_list, destroy_msg, -ETIMEDOUT); 99 99 dput(dentry); 100 100 } ··· 152 152 dentry = dget(pipe->dentry); 153 153 spin_unlock(&pipe->lock); 154 154 if (dentry) { 155 - wake_up(&RPC_I(dentry->d_inode)->waitq); 155 + wake_up(&RPC_I(d_inode(dentry))->waitq); 156 156 dput(dentry); 157 157 } 158 158 return res; ··· 591 591 err = __rpc_create_common(dir, dentry, S_IFIFO | mode, i_fop, private); 592 592 if (err) 593 593 return err; 594 - rpci = RPC_I(dentry->d_inode); 594 + rpci = RPC_I(d_inode(dentry)); 595 595 rpci->private = private; 596 596 rpci->pipe = pipe; 597 597 fsnotify_create(dir, dentry); ··· 616 616 int error; 617 617 618 618 parent = dget_parent(dentry); 619 - dir = parent->d_inode; 619 + dir = d_inode(parent); 620 620 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); 621 621 error = __rpc_rmdir(dir, dentry); 622 622 mutex_unlock(&dir->i_mutex); ··· 638 638 639 639 static 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 643 rpc_close_pipes(inode); 644 644 return __rpc_unlink(dir, dentry); ··· 654 654 if (!dentry) 655 655 return ERR_PTR(-ENOMEM); 656 656 } 657 - if (dentry->d_inode == NULL) 657 + if (d_really_is_negative(dentry)) 658 658 return dentry; 659 659 dput(dentry); 660 660 return ERR_PTR(-EEXIST); ··· 667 667 const struct rpc_filelist *files, 668 668 int start, int eof) 669 669 { 670 - struct inode *dir = parent->d_inode; 670 + struct inode *dir = d_inode(parent); 671 671 struct dentry *dentry; 672 672 struct qstr name; 673 673 int i; ··· 679 679 680 680 if (dentry == NULL) 681 681 continue; 682 - if (dentry->d_inode == NULL) 682 + if (d_really_is_negative(dentry)) 683 683 goto next; 684 - switch (dentry->d_inode->i_mode & S_IFMT) { 684 + switch (d_inode(dentry)->i_mode & S_IFMT) { 685 685 default: 686 686 BUG(); 687 687 case S_IFREG: ··· 699 699 const struct rpc_filelist *files, 700 700 int start, int eof) 701 701 { 702 - struct inode *dir = parent->d_inode; 702 + struct inode *dir = d_inode(parent); 703 703 704 704 mutex_lock_nested(&dir->i_mutex, I_MUTEX_CHILD); 705 705 __rpc_depopulate(parent, files, start, eof); ··· 711 711 int start, int eof, 712 712 void *private) 713 713 { 714 - struct inode *dir = parent->d_inode; 714 + struct inode *dir = d_inode(parent); 715 715 struct dentry *dentry; 716 716 int i, err; 717 717 ··· 754 754 int (*populate)(struct dentry *, void *), void *args_populate) 755 755 { 756 756 struct dentry *dentry; 757 - struct inode *dir = parent->d_inode; 757 + struct inode *dir = d_inode(parent); 758 758 int error; 759 759 760 760 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); ··· 787 787 int error; 788 788 789 789 parent = dget_parent(dentry); 790 - dir = parent->d_inode; 790 + dir = d_inode(parent); 791 791 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); 792 792 if (depopulate != NULL) 793 793 depopulate(dentry); ··· 819 819 void *private, struct rpc_pipe *pipe) 820 820 { 821 821 struct dentry *dentry; 822 - struct inode *dir = parent->d_inode; 822 + struct inode *dir = d_inode(parent); 823 823 umode_t umode = S_IFIFO | S_IRUSR | S_IWUSR; 824 824 int err; 825 825 ··· 864 864 int error = 0; 865 865 866 866 parent = dget_parent(dentry); 867 - dir = parent->d_inode; 867 + dir = d_inode(parent); 868 868 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); 869 869 error = __rpc_rmpipe(dir, dentry); 870 870 mutex_unlock(&dir->i_mutex); ··· 1375 1375 struct dentry *clnt_dir = pipe_dentry->d_parent; 1376 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 1379 __rpc_depopulate(clnt_dir, gssd_dummy_info_file, 0, 1); 1380 1380 __rpc_depopulate(gssd_dir, gssd_dummy_clnt_dir, 0, 1); 1381 1381 dput(pipe_dentry);