aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-03-17 18:25:59 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-15 15:06:57 -0400
commit2b0143b5c986be1ce8408b3aadc4709e0a94429d (patch)
tree98b1dee70f3d5d9ac9309f4638e41864ddcd0952 /fs/afs
parentce0b16ddf18df35026164fda4a642ef10c01f442 (diff)
VFS: normal filesystems (and lustre): d_inode() annotations
that's the bulk of filesystem drivers dealing with inodes of their own Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/dir.c42
-rw-r--r--fs/afs/inode.c4
-rw-r--r--fs/afs/mntpt.c8
-rw-r--r--fs/afs/super.c2
4 files changed, 28 insertions, 28 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 4ec35e9130e1..e10e17788f06 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -505,7 +505,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
505 _enter("{%x:%u},%p{%pd},", 505 _enter("{%x:%u},%p{%pd},",
506 vnode->fid.vid, vnode->fid.vnode, dentry, dentry); 506 vnode->fid.vid, vnode->fid.vnode, dentry, dentry);
507 507
508 ASSERTCMP(dentry->d_inode, ==, NULL); 508 ASSERTCMP(d_inode(dentry), ==, NULL);
509 509
510 if (dentry->d_name.len >= AFSNAMEMAX) { 510 if (dentry->d_name.len >= AFSNAMEMAX) {
511 _leave(" = -ENAMETOOLONG"); 511 _leave(" = -ENAMETOOLONG");
@@ -563,8 +563,8 @@ success:
563 _leave(" = 0 { vn=%u u=%u } -> { ino=%lu v=%u }", 563 _leave(" = 0 { vn=%u u=%u } -> { ino=%lu v=%u }",
564 fid.vnode, 564 fid.vnode,
565 fid.unique, 565 fid.unique,
566 dentry->d_inode->i_ino, 566 d_inode(dentry)->i_ino,
567 dentry->d_inode->i_generation); 567 d_inode(dentry)->i_generation);
568 568
569 return NULL; 569 return NULL;
570} 570}
@@ -586,9 +586,9 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
586 if (flags & LOOKUP_RCU) 586 if (flags & LOOKUP_RCU)
587 return -ECHILD; 587 return -ECHILD;
588 588
589 vnode = AFS_FS_I(dentry->d_inode); 589 vnode = AFS_FS_I(d_inode(dentry));
590 590
591 if (dentry->d_inode) 591 if (d_really_is_positive(dentry))
592 _enter("{v={%x:%u} n=%pd fl=%lx},", 592 _enter("{v={%x:%u} n=%pd fl=%lx},",
593 vnode->fid.vid, vnode->fid.vnode, dentry, 593 vnode->fid.vid, vnode->fid.vnode, dentry,
594 vnode->flags); 594 vnode->flags);
@@ -601,7 +601,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
601 601
602 /* lock down the parent dentry so we can peer at it */ 602 /* lock down the parent dentry so we can peer at it */
603 parent = dget_parent(dentry); 603 parent = dget_parent(dentry);
604 dir = AFS_FS_I(parent->d_inode); 604 dir = AFS_FS_I(d_inode(parent));
605 605
606 /* validate the parent directory */ 606 /* validate the parent directory */
607 if (test_bit(AFS_VNODE_MODIFIED, &dir->flags)) 607 if (test_bit(AFS_VNODE_MODIFIED, &dir->flags))
@@ -623,9 +623,9 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
623 switch (ret) { 623 switch (ret) {
624 case 0: 624 case 0:
625 /* the filename maps to something */ 625 /* the filename maps to something */
626 if (!dentry->d_inode) 626 if (d_really_is_negative(dentry))
627 goto out_bad; 627 goto out_bad;
628 if (is_bad_inode(dentry->d_inode)) { 628 if (is_bad_inode(d_inode(dentry))) {
629 printk("kAFS: afs_d_revalidate: %pd2 has bad inode\n", 629 printk("kAFS: afs_d_revalidate: %pd2 has bad inode\n",
630 dentry); 630 dentry);
631 goto out_bad; 631 goto out_bad;
@@ -647,7 +647,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
647 _debug("%pd: file deleted (uq %u -> %u I:%u)", 647 _debug("%pd: file deleted (uq %u -> %u I:%u)",
648 dentry, fid.unique, 648 dentry, fid.unique,
649 vnode->fid.unique, 649 vnode->fid.unique,
650 dentry->d_inode->i_generation); 650 d_inode(dentry)->i_generation);
651 spin_lock(&vnode->lock); 651 spin_lock(&vnode->lock);
652 set_bit(AFS_VNODE_DELETED, &vnode->flags); 652 set_bit(AFS_VNODE_DELETED, &vnode->flags);
653 spin_unlock(&vnode->lock); 653 spin_unlock(&vnode->lock);
@@ -658,7 +658,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
658 case -ENOENT: 658 case -ENOENT:
659 /* the filename is unknown */ 659 /* the filename is unknown */
660 _debug("%pd: dirent not found", dentry); 660 _debug("%pd: dirent not found", dentry);
661 if (dentry->d_inode) 661 if (d_really_is_positive(dentry))
662 goto not_found; 662 goto not_found;
663 goto out_valid; 663 goto out_valid;
664 664
@@ -703,9 +703,9 @@ static int afs_d_delete(const struct dentry *dentry)
703 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) 703 if (dentry->d_flags & DCACHE_NFSFS_RENAMED)
704 goto zap; 704 goto zap;
705 705
706 if (dentry->d_inode && 706 if (d_really_is_positive(dentry) &&
707 (test_bit(AFS_VNODE_DELETED, &AFS_FS_I(dentry->d_inode)->flags) || 707 (test_bit(AFS_VNODE_DELETED, &AFS_FS_I(d_inode(dentry))->flags) ||
708 test_bit(AFS_VNODE_PSEUDODIR, &AFS_FS_I(dentry->d_inode)->flags))) 708 test_bit(AFS_VNODE_PSEUDODIR, &AFS_FS_I(d_inode(dentry))->flags)))
709 goto zap; 709 goto zap;
710 710
711 _leave(" = 0 [keep]"); 711 _leave(" = 0 [keep]");
@@ -814,8 +814,8 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry)
814 if (ret < 0) 814 if (ret < 0)
815 goto rmdir_error; 815 goto rmdir_error;
816 816
817 if (dentry->d_inode) { 817 if (d_really_is_positive(dentry)) {
818 vnode = AFS_FS_I(dentry->d_inode); 818 vnode = AFS_FS_I(d_inode(dentry));
819 clear_nlink(&vnode->vfs_inode); 819 clear_nlink(&vnode->vfs_inode);
820 set_bit(AFS_VNODE_DELETED, &vnode->flags); 820 set_bit(AFS_VNODE_DELETED, &vnode->flags);
821 afs_discard_callback_on_delete(vnode); 821 afs_discard_callback_on_delete(vnode);
@@ -856,8 +856,8 @@ static int afs_unlink(struct inode *dir, struct dentry *dentry)
856 goto error; 856 goto error;
857 } 857 }
858 858
859 if (dentry->d_inode) { 859 if (d_really_is_positive(dentry)) {
860 vnode = AFS_FS_I(dentry->d_inode); 860 vnode = AFS_FS_I(d_inode(dentry));
861 861
862 /* make sure we have a callback promise on the victim */ 862 /* make sure we have a callback promise on the victim */
863 ret = afs_validate(vnode, key); 863 ret = afs_validate(vnode, key);
@@ -869,7 +869,7 @@ static int afs_unlink(struct inode *dir, struct dentry *dentry)
869 if (ret < 0) 869 if (ret < 0)
870 goto remove_error; 870 goto remove_error;
871 871
872 if (dentry->d_inode) { 872 if (d_really_is_positive(dentry)) {
873 /* if the file wasn't deleted due to excess hard links, the 873 /* if the file wasn't deleted due to excess hard links, the
874 * fileserver will break the callback promise on the file - if 874 * fileserver will break the callback promise on the file - if
875 * it had one - before it returns to us, and if it was deleted, 875 * it had one - before it returns to us, and if it was deleted,
@@ -879,7 +879,7 @@ static int afs_unlink(struct inode *dir, struct dentry *dentry)
879 * or it was outstanding on a different server, then it won't 879 * or it was outstanding on a different server, then it won't
880 * break it either... 880 * break it either...
881 */ 881 */
882 vnode = AFS_FS_I(dentry->d_inode); 882 vnode = AFS_FS_I(d_inode(dentry));
883 if (test_bit(AFS_VNODE_DELETED, &vnode->flags)) 883 if (test_bit(AFS_VNODE_DELETED, &vnode->flags))
884 _debug("AFS_VNODE_DELETED"); 884 _debug("AFS_VNODE_DELETED");
885 if (test_bit(AFS_VNODE_CB_BROKEN, &vnode->flags)) 885 if (test_bit(AFS_VNODE_CB_BROKEN, &vnode->flags))
@@ -977,7 +977,7 @@ static int afs_link(struct dentry *from, struct inode *dir,
977 struct key *key; 977 struct key *key;
978 int ret; 978 int ret;
979 979
980 vnode = AFS_FS_I(from->d_inode); 980 vnode = AFS_FS_I(d_inode(from));
981 dvnode = AFS_FS_I(dir); 981 dvnode = AFS_FS_I(dir);
982 982
983 _enter("{%x:%u},{%x:%u},{%pd}", 983 _enter("{%x:%u},{%x:%u},{%pd}",
@@ -1089,7 +1089,7 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
1089 struct key *key; 1089 struct key *key;
1090 int ret; 1090 int ret;
1091 1091
1092 vnode = AFS_FS_I(old_dentry->d_inode); 1092 vnode = AFS_FS_I(d_inode(old_dentry));
1093 orig_dvnode = AFS_FS_I(old_dir); 1093 orig_dvnode = AFS_FS_I(old_dir);
1094 new_dvnode = AFS_FS_I(new_dir); 1094 new_dvnode = AFS_FS_I(new_dir);
1095 1095
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 8a1d38ef0fc2..e06f5a23352a 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -379,7 +379,7 @@ int afs_getattr(struct vfsmount *mnt, struct dentry *dentry,
379{ 379{
380 struct inode *inode; 380 struct inode *inode;
381 381
382 inode = dentry->d_inode; 382 inode = d_inode(dentry);
383 383
384 _enter("{ ino=%lu v=%u }", inode->i_ino, inode->i_generation); 384 _enter("{ ino=%lu v=%u }", inode->i_ino, inode->i_generation);
385 385
@@ -458,7 +458,7 @@ void afs_evict_inode(struct inode *inode)
458 */ 458 */
459int afs_setattr(struct dentry *dentry, struct iattr *attr) 459int afs_setattr(struct dentry *dentry, struct iattr *attr)
460{ 460{
461 struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode); 461 struct afs_vnode *vnode = AFS_FS_I(d_inode(dentry));
462 struct key *key; 462 struct key *key;
463 int ret; 463 int ret;
464 464
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c
index 938c5ab06d5a..ccd0b212e82a 100644
--- a/fs/afs/mntpt.c
+++ b/fs/afs/mntpt.c
@@ -134,7 +134,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
134 134
135 _enter("{%pd}", mntpt); 135 _enter("{%pd}", mntpt);
136 136
137 BUG_ON(!mntpt->d_inode); 137 BUG_ON(!d_inode(mntpt));
138 138
139 ret = -ENOMEM; 139 ret = -ENOMEM;
140 devname = (char *) get_zeroed_page(GFP_KERNEL); 140 devname = (char *) get_zeroed_page(GFP_KERNEL);
@@ -145,7 +145,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
145 if (!options) 145 if (!options)
146 goto error_no_options; 146 goto error_no_options;
147 147
148 vnode = AFS_FS_I(mntpt->d_inode); 148 vnode = AFS_FS_I(d_inode(mntpt));
149 if (test_bit(AFS_VNODE_PSEUDODIR, &vnode->flags)) { 149 if (test_bit(AFS_VNODE_PSEUDODIR, &vnode->flags)) {
150 /* if the directory is a pseudo directory, use the d_name */ 150 /* if the directory is a pseudo directory, use the d_name */
151 static const char afs_root_cell[] = ":root.cell."; 151 static const char afs_root_cell[] = ":root.cell.";
@@ -169,14 +169,14 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
169 } 169 }
170 } else { 170 } else {
171 /* read the contents of the AFS special symlink */ 171 /* read the contents of the AFS special symlink */
172 loff_t size = i_size_read(mntpt->d_inode); 172 loff_t size = i_size_read(d_inode(mntpt));
173 char *buf; 173 char *buf;
174 174
175 ret = -EINVAL; 175 ret = -EINVAL;
176 if (size > PAGE_SIZE - 1) 176 if (size > PAGE_SIZE - 1)
177 goto error_no_page; 177 goto error_no_page;
178 178
179 page = read_mapping_page(mntpt->d_inode->i_mapping, 0, NULL); 179 page = read_mapping_page(d_inode(mntpt)->i_mapping, 0, NULL);
180 if (IS_ERR(page)) { 180 if (IS_ERR(page)) {
181 ret = PTR_ERR(page); 181 ret = PTR_ERR(page);
182 goto error_no_page; 182 goto error_no_page;
diff --git a/fs/afs/super.c b/fs/afs/super.c
index c4861557e385..1fb4a5129f7d 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -529,7 +529,7 @@ static void afs_destroy_inode(struct inode *inode)
529static int afs_statfs(struct dentry *dentry, struct kstatfs *buf) 529static int afs_statfs(struct dentry *dentry, struct kstatfs *buf)
530{ 530{
531 struct afs_volume_status vs; 531 struct afs_volume_status vs;
532 struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode); 532 struct afs_vnode *vnode = AFS_FS_I(d_inode(dentry));
533 struct key *key; 533 struct key *key;
534 int ret; 534 int ret;
535 535