aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-03-17 18:26:21 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-15 15:06:59 -0400
commit466b77bc954c23c5741ea7dd02f20212a72acdb2 (patch)
tree3efb3c39c814d58c11435815b9fa9dedc7035731 /fs
parentdea655c28a32ac760c057383dadb5be0f5632362 (diff)
VFS: fs/cachefiles: d_backing_inode() annotations
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/cachefiles/bind.c10
-rw-r--r--fs/cachefiles/interface.c2
-rw-r--r--fs/cachefiles/namei.c70
-rw-r--r--fs/cachefiles/rdwr.c14
-rw-r--r--fs/cachefiles/security.c6
-rw-r--r--fs/cachefiles/xattr.c22
6 files changed, 62 insertions, 62 deletions
diff --git a/fs/cachefiles/bind.c b/fs/cachefiles/bind.c
index fbb08e97438d..6af790fc3df8 100644
--- a/fs/cachefiles/bind.c
+++ b/fs/cachefiles/bind.c
@@ -123,11 +123,11 @@ static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache)
123 123
124 /* check parameters */ 124 /* check parameters */
125 ret = -EOPNOTSUPP; 125 ret = -EOPNOTSUPP;
126 if (!root->d_inode || 126 if (d_is_negative(root) ||
127 !root->d_inode->i_op->lookup || 127 !d_backing_inode(root)->i_op->lookup ||
128 !root->d_inode->i_op->mkdir || 128 !d_backing_inode(root)->i_op->mkdir ||
129 !root->d_inode->i_op->setxattr || 129 !d_backing_inode(root)->i_op->setxattr ||
130 !root->d_inode->i_op->getxattr || 130 !d_backing_inode(root)->i_op->getxattr ||
131 !root->d_sb->s_op->statfs || 131 !root->d_sb->s_op->statfs ||
132 !root->d_sb->s_op->sync_fs) 132 !root->d_sb->s_op->sync_fs)
133 goto error_unsupported; 133 goto error_unsupported;
diff --git a/fs/cachefiles/interface.c b/fs/cachefiles/interface.c
index f1fb0a21bb5a..afa023dded5b 100644
--- a/fs/cachefiles/interface.c
+++ b/fs/cachefiles/interface.c
@@ -441,7 +441,7 @@ static int cachefiles_attr_changed(struct fscache_object *_object)
441 441
442 fscache_set_store_limit(&object->fscache, ni_size); 442 fscache_set_store_limit(&object->fscache, ni_size);
443 443
444 oi_size = i_size_read(object->backer->d_inode); 444 oi_size = i_size_read(d_backing_inode(object->backer));
445 if (oi_size == ni_size) 445 if (oi_size == ni_size)
446 return 0; 446 return 0;
447 447
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
index 61396359863f..ab857ab9f40d 100644
--- a/fs/cachefiles/namei.c
+++ b/fs/cachefiles/namei.c
@@ -355,7 +355,7 @@ try_again:
355 return -EIO; 355 return -EIO;
356 } 356 }
357 357
358 if (grave->d_inode) { 358 if (d_is_positive(grave)) {
359 unlock_rename(cache->graveyard, dir); 359 unlock_rename(cache->graveyard, dir);
360 dput(grave); 360 dput(grave);
361 grave = NULL; 361 grave = NULL;
@@ -415,7 +415,7 @@ int cachefiles_delete_object(struct cachefiles_cache *cache,
415 _enter(",OBJ%x{%p}", object->fscache.debug_id, object->dentry); 415 _enter(",OBJ%x{%p}", object->fscache.debug_id, object->dentry);
416 416
417 ASSERT(object->dentry); 417 ASSERT(object->dentry);
418 ASSERT(object->dentry->d_inode); 418 ASSERT(d_backing_inode(object->dentry));
419 ASSERT(object->dentry->d_parent); 419 ASSERT(object->dentry->d_parent);
420 420
421 dir = dget_parent(object->dentry); 421 dir = dget_parent(object->dentry);
@@ -473,7 +473,7 @@ int cachefiles_walk_to_object(struct cachefiles_object *parent,
473 path.mnt = cache->mnt; 473 path.mnt = cache->mnt;
474 474
475 ASSERT(parent->dentry); 475 ASSERT(parent->dentry);
476 ASSERT(parent->dentry->d_inode); 476 ASSERT(d_backing_inode(parent->dentry));
477 477
478 if (!(d_is_dir(parent->dentry))) { 478 if (!(d_is_dir(parent->dentry))) {
479 // TODO: convert file to dir 479 // TODO: convert file to dir
@@ -505,21 +505,21 @@ lookup_again:
505 if (IS_ERR(next)) 505 if (IS_ERR(next))
506 goto lookup_error; 506 goto lookup_error;
507 507
508 _debug("next -> %p %s", next, next->d_inode ? "positive" : "negative"); 508 _debug("next -> %p %s", next, d_backing_inode(next) ? "positive" : "negative");
509 509
510 if (!key) 510 if (!key)
511 object->new = !next->d_inode; 511 object->new = !d_backing_inode(next);
512 512
513 /* if this element of the path doesn't exist, then the lookup phase 513 /* if this element of the path doesn't exist, then the lookup phase
514 * failed, and we can release any readers in the certain knowledge that 514 * failed, and we can release any readers in the certain knowledge that
515 * there's nothing for them to actually read */ 515 * there's nothing for them to actually read */
516 if (!next->d_inode) 516 if (d_is_negative(next))
517 fscache_object_lookup_negative(&object->fscache); 517 fscache_object_lookup_negative(&object->fscache);
518 518
519 /* we need to create the object if it's negative */ 519 /* we need to create the object if it's negative */
520 if (key || object->type == FSCACHE_COOKIE_TYPE_INDEX) { 520 if (key || object->type == FSCACHE_COOKIE_TYPE_INDEX) {
521 /* index objects and intervening tree levels must be subdirs */ 521 /* index objects and intervening tree levels must be subdirs */
522 if (!next->d_inode) { 522 if (d_is_negative(next)) {
523 ret = cachefiles_has_space(cache, 1, 0); 523 ret = cachefiles_has_space(cache, 1, 0);
524 if (ret < 0) 524 if (ret < 0)
525 goto create_error; 525 goto create_error;
@@ -534,21 +534,21 @@ lookup_again:
534 if (ret < 0) 534 if (ret < 0)
535 goto create_error; 535 goto create_error;
536 536
537 ASSERT(next->d_inode); 537 ASSERT(d_backing_inode(next));
538 538
539 _debug("mkdir -> %p{%p{ino=%lu}}", 539 _debug("mkdir -> %p{%p{ino=%lu}}",
540 next, next->d_inode, next->d_inode->i_ino); 540 next, d_backing_inode(next), d_backing_inode(next)->i_ino);
541 541
542 } else if (!d_can_lookup(next)) { 542 } else if (!d_can_lookup(next)) {
543 pr_err("inode %lu is not a directory\n", 543 pr_err("inode %lu is not a directory\n",
544 next->d_inode->i_ino); 544 d_backing_inode(next)->i_ino);
545 ret = -ENOBUFS; 545 ret = -ENOBUFS;
546 goto error; 546 goto error;
547 } 547 }
548 548
549 } else { 549 } else {
550 /* non-index objects start out life as files */ 550 /* non-index objects start out life as files */
551 if (!next->d_inode) { 551 if (d_is_negative(next)) {
552 ret = cachefiles_has_space(cache, 1, 0); 552 ret = cachefiles_has_space(cache, 1, 0);
553 if (ret < 0) 553 if (ret < 0)
554 goto create_error; 554 goto create_error;
@@ -563,16 +563,16 @@ lookup_again:
563 if (ret < 0) 563 if (ret < 0)
564 goto create_error; 564 goto create_error;
565 565
566 ASSERT(next->d_inode); 566 ASSERT(d_backing_inode(next));
567 567
568 _debug("create -> %p{%p{ino=%lu}}", 568 _debug("create -> %p{%p{ino=%lu}}",
569 next, next->d_inode, next->d_inode->i_ino); 569 next, d_backing_inode(next), d_backing_inode(next)->i_ino);
570 570
571 } else if (!d_can_lookup(next) && 571 } else if (!d_can_lookup(next) &&
572 !d_is_reg(next) 572 !d_is_reg(next)
573 ) { 573 ) {
574 pr_err("inode %lu is not a file or directory\n", 574 pr_err("inode %lu is not a file or directory\n",
575 next->d_inode->i_ino); 575 d_backing_inode(next)->i_ino);
576 ret = -ENOBUFS; 576 ret = -ENOBUFS;
577 goto error; 577 goto error;
578 } 578 }
@@ -646,7 +646,7 @@ lookup_again:
646 const struct address_space_operations *aops; 646 const struct address_space_operations *aops;
647 647
648 ret = -EPERM; 648 ret = -EPERM;
649 aops = object->dentry->d_inode->i_mapping->a_ops; 649 aops = d_backing_inode(object->dentry)->i_mapping->a_ops;
650 if (!aops->bmap) 650 if (!aops->bmap)
651 goto check_error; 651 goto check_error;
652 652
@@ -659,7 +659,7 @@ lookup_again:
659 object->new = 0; 659 object->new = 0;
660 fscache_obtained_object(&object->fscache); 660 fscache_obtained_object(&object->fscache);
661 661
662 _leave(" = 0 [%lu]", object->dentry->d_inode->i_ino); 662 _leave(" = 0 [%lu]", d_backing_inode(object->dentry)->i_ino);
663 return 0; 663 return 0;
664 664
665create_error: 665create_error:
@@ -731,10 +731,10 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
731 } 731 }
732 732
733 _debug("subdir -> %p %s", 733 _debug("subdir -> %p %s",
734 subdir, subdir->d_inode ? "positive" : "negative"); 734 subdir, d_backing_inode(subdir) ? "positive" : "negative");
735 735
736 /* we need to create the subdir if it doesn't exist yet */ 736 /* we need to create the subdir if it doesn't exist yet */
737 if (!subdir->d_inode) { 737 if (d_is_negative(subdir)) {
738 ret = cachefiles_has_space(cache, 1, 0); 738 ret = cachefiles_has_space(cache, 1, 0);
739 if (ret < 0) 739 if (ret < 0)
740 goto mkdir_error; 740 goto mkdir_error;
@@ -750,18 +750,18 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
750 if (ret < 0) 750 if (ret < 0)
751 goto mkdir_error; 751 goto mkdir_error;
752 752
753 ASSERT(subdir->d_inode); 753 ASSERT(d_backing_inode(subdir));
754 754
755 _debug("mkdir -> %p{%p{ino=%lu}}", 755 _debug("mkdir -> %p{%p{ino=%lu}}",
756 subdir, 756 subdir,
757 subdir->d_inode, 757 d_backing_inode(subdir),
758 subdir->d_inode->i_ino); 758 d_backing_inode(subdir)->i_ino);
759 } 759 }
760 760
761 mutex_unlock(&d_inode(dir)->i_mutex); 761 mutex_unlock(&d_inode(dir)->i_mutex);
762 762
763 /* we need to make sure the subdir is a directory */ 763 /* we need to make sure the subdir is a directory */
764 ASSERT(subdir->d_inode); 764 ASSERT(d_backing_inode(subdir));
765 765
766 if (!d_can_lookup(subdir)) { 766 if (!d_can_lookup(subdir)) {
767 pr_err("%s is not a directory\n", dirname); 767 pr_err("%s is not a directory\n", dirname);
@@ -770,18 +770,18 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
770 } 770 }
771 771
772 ret = -EPERM; 772 ret = -EPERM;
773 if (!subdir->d_inode->i_op->setxattr || 773 if (!d_backing_inode(subdir)->i_op->setxattr ||
774 !subdir->d_inode->i_op->getxattr || 774 !d_backing_inode(subdir)->i_op->getxattr ||
775 !subdir->d_inode->i_op->lookup || 775 !d_backing_inode(subdir)->i_op->lookup ||
776 !subdir->d_inode->i_op->mkdir || 776 !d_backing_inode(subdir)->i_op->mkdir ||
777 !subdir->d_inode->i_op->create || 777 !d_backing_inode(subdir)->i_op->create ||
778 (!subdir->d_inode->i_op->rename && 778 (!d_backing_inode(subdir)->i_op->rename &&
779 !subdir->d_inode->i_op->rename2) || 779 !d_backing_inode(subdir)->i_op->rename2) ||
780 !subdir->d_inode->i_op->rmdir || 780 !d_backing_inode(subdir)->i_op->rmdir ||
781 !subdir->d_inode->i_op->unlink) 781 !d_backing_inode(subdir)->i_op->unlink)
782 goto check_error; 782 goto check_error;
783 783
784 _leave(" = [%lu]", subdir->d_inode->i_ino); 784 _leave(" = [%lu]", d_backing_inode(subdir)->i_ino);
785 return subdir; 785 return subdir;
786 786
787check_error: 787check_error:
@@ -836,12 +836,12 @@ static struct dentry *cachefiles_check_active(struct cachefiles_cache *cache,
836 goto lookup_error; 836 goto lookup_error;
837 837
838 //_debug("victim -> %p %s", 838 //_debug("victim -> %p %s",
839 // victim, victim->d_inode ? "positive" : "negative"); 839 // victim, d_backing_inode(victim) ? "positive" : "negative");
840 840
841 /* if the object is no longer there then we probably retired the object 841 /* if the object is no longer there then we probably retired the object
842 * at the netfs's request whilst the cull was in progress 842 * at the netfs's request whilst the cull was in progress
843 */ 843 */
844 if (!victim->d_inode) { 844 if (d_is_negative(victim)) {
845 mutex_unlock(&d_inode(dir)->i_mutex); 845 mutex_unlock(&d_inode(dir)->i_mutex);
846 dput(victim); 846 dput(victim);
847 _leave(" = -ENOENT [absent]"); 847 _leave(" = -ENOENT [absent]");
@@ -913,7 +913,7 @@ int cachefiles_cull(struct cachefiles_cache *cache, struct dentry *dir,
913 return PTR_ERR(victim); 913 return PTR_ERR(victim);
914 914
915 _debug("victim -> %p %s", 915 _debug("victim -> %p %s",
916 victim, victim->d_inode ? "positive" : "negative"); 916 victim, d_backing_inode(victim) ? "positive" : "negative");
917 917
918 /* okay... the victim is not being used so we can cull it 918 /* okay... the victim is not being used so we can cull it
919 * - start by marking it as stale 919 * - start by marking it as stale
diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
index c6cd8d7a4eef..3cbb0e834694 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -74,12 +74,12 @@ static int cachefiles_read_waiter(wait_queue_t *wait, unsigned mode,
74static int cachefiles_read_reissue(struct cachefiles_object *object, 74static int cachefiles_read_reissue(struct cachefiles_object *object,
75 struct cachefiles_one_read *monitor) 75 struct cachefiles_one_read *monitor)
76{ 76{
77 struct address_space *bmapping = object->backer->d_inode->i_mapping; 77 struct address_space *bmapping = d_backing_inode(object->backer)->i_mapping;
78 struct page *backpage = monitor->back_page, *backpage2; 78 struct page *backpage = monitor->back_page, *backpage2;
79 int ret; 79 int ret;
80 80
81 _enter("{ino=%lx},{%lx,%lx}", 81 _enter("{ino=%lx},{%lx,%lx}",
82 object->backer->d_inode->i_ino, 82 d_backing_inode(object->backer)->i_ino,
83 backpage->index, backpage->flags); 83 backpage->index, backpage->flags);
84 84
85 /* skip if the page was truncated away completely */ 85 /* skip if the page was truncated away completely */
@@ -157,7 +157,7 @@ static void cachefiles_read_copier(struct fscache_operation *_op)
157 object = container_of(op->op.object, 157 object = container_of(op->op.object,
158 struct cachefiles_object, fscache); 158 struct cachefiles_object, fscache);
159 159
160 _enter("{ino=%lu}", object->backer->d_inode->i_ino); 160 _enter("{ino=%lu}", d_backing_inode(object->backer)->i_ino);
161 161
162 max = 8; 162 max = 8;
163 spin_lock_irq(&object->work_lock); 163 spin_lock_irq(&object->work_lock);
@@ -247,7 +247,7 @@ static int cachefiles_read_backing_file_one(struct cachefiles_object *object,
247 init_waitqueue_func_entry(&monitor->monitor, cachefiles_read_waiter); 247 init_waitqueue_func_entry(&monitor->monitor, cachefiles_read_waiter);
248 248
249 /* attempt to get hold of the backing page */ 249 /* attempt to get hold of the backing page */
250 bmapping = object->backer->d_inode->i_mapping; 250 bmapping = d_backing_inode(object->backer)->i_mapping;
251 newpage = NULL; 251 newpage = NULL;
252 252
253 for (;;) { 253 for (;;) {
@@ -408,7 +408,7 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op,
408 if (!object->backer) 408 if (!object->backer)
409 goto enobufs; 409 goto enobufs;
410 410
411 inode = object->backer->d_inode; 411 inode = d_backing_inode(object->backer);
412 ASSERT(S_ISREG(inode->i_mode)); 412 ASSERT(S_ISREG(inode->i_mode));
413 ASSERT(inode->i_mapping->a_ops->bmap); 413 ASSERT(inode->i_mapping->a_ops->bmap);
414 ASSERT(inode->i_mapping->a_ops->readpages); 414 ASSERT(inode->i_mapping->a_ops->readpages);
@@ -468,7 +468,7 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
468 struct list_head *list) 468 struct list_head *list)
469{ 469{
470 struct cachefiles_one_read *monitor = NULL; 470 struct cachefiles_one_read *monitor = NULL;
471 struct address_space *bmapping = object->backer->d_inode->i_mapping; 471 struct address_space *bmapping = d_backing_inode(object->backer)->i_mapping;
472 struct page *newpage = NULL, *netpage, *_n, *backpage = NULL; 472 struct page *newpage = NULL, *netpage, *_n, *backpage = NULL;
473 int ret = 0; 473 int ret = 0;
474 474
@@ -705,7 +705,7 @@ int cachefiles_read_or_alloc_pages(struct fscache_retrieval *op,
705 if (cachefiles_has_space(cache, 0, *nr_pages) < 0) 705 if (cachefiles_has_space(cache, 0, *nr_pages) < 0)
706 space = 0; 706 space = 0;
707 707
708 inode = object->backer->d_inode; 708 inode = d_backing_inode(object->backer);
709 ASSERT(S_ISREG(inode->i_mode)); 709 ASSERT(S_ISREG(inode->i_mode));
710 ASSERT(inode->i_mapping->a_ops->bmap); 710 ASSERT(inode->i_mapping->a_ops->bmap);
711 ASSERT(inode->i_mapping->a_ops->readpages); 711 ASSERT(inode->i_mapping->a_ops->readpages);
diff --git a/fs/cachefiles/security.c b/fs/cachefiles/security.c
index 396c18ea2764..31bbc0528b11 100644
--- a/fs/cachefiles/security.c
+++ b/fs/cachefiles/security.c
@@ -55,14 +55,14 @@ static int cachefiles_check_cache_dir(struct cachefiles_cache *cache,
55{ 55{
56 int ret; 56 int ret;
57 57
58 ret = security_inode_mkdir(root->d_inode, root, 0); 58 ret = security_inode_mkdir(d_backing_inode(root), root, 0);
59 if (ret < 0) { 59 if (ret < 0) {
60 pr_err("Security denies permission to make dirs: error %d", 60 pr_err("Security denies permission to make dirs: error %d",
61 ret); 61 ret);
62 return ret; 62 return ret;
63 } 63 }
64 64
65 ret = security_inode_create(root->d_inode, root, 0); 65 ret = security_inode_create(d_backing_inode(root), root, 0);
66 if (ret < 0) 66 if (ret < 0)
67 pr_err("Security denies permission to create files: error %d", 67 pr_err("Security denies permission to create files: error %d",
68 ret); 68 ret);
@@ -95,7 +95,7 @@ int cachefiles_determine_cache_security(struct cachefiles_cache *cache,
95 95
96 /* use the cache root dir's security context as the basis with 96 /* use the cache root dir's security context as the basis with
97 * which create files */ 97 * which create files */
98 ret = set_create_files_as(new, root->d_inode); 98 ret = set_create_files_as(new, d_backing_inode(root));
99 if (ret < 0) { 99 if (ret < 0) {
100 abort_creds(new); 100 abort_creds(new);
101 cachefiles_begin_secure(cache, _saved_cred); 101 cachefiles_begin_secure(cache, _saved_cred);
diff --git a/fs/cachefiles/xattr.c b/fs/cachefiles/xattr.c
index a8a68745e11d..d31c1a72d8a5 100644
--- a/fs/cachefiles/xattr.c
+++ b/fs/cachefiles/xattr.c
@@ -33,7 +33,7 @@ int cachefiles_check_object_type(struct cachefiles_object *object)
33 int ret; 33 int ret;
34 34
35 ASSERT(dentry); 35 ASSERT(dentry);
36 ASSERT(dentry->d_inode); 36 ASSERT(d_backing_inode(dentry));
37 37
38 if (!object->fscache.cookie) 38 if (!object->fscache.cookie)
39 strcpy(type, "C3"); 39 strcpy(type, "C3");
@@ -52,7 +52,7 @@ int cachefiles_check_object_type(struct cachefiles_object *object)
52 52
53 if (ret != -EEXIST) { 53 if (ret != -EEXIST) {
54 pr_err("Can't set xattr on %pd [%lu] (err %d)\n", 54 pr_err("Can't set xattr on %pd [%lu] (err %d)\n",
55 dentry, dentry->d_inode->i_ino, 55 dentry, d_backing_inode(dentry)->i_ino,
56 -ret); 56 -ret);
57 goto error; 57 goto error;
58 } 58 }
@@ -64,7 +64,7 @@ int cachefiles_check_object_type(struct cachefiles_object *object)
64 goto bad_type_length; 64 goto bad_type_length;
65 65
66 pr_err("Can't read xattr on %pd [%lu] (err %d)\n", 66 pr_err("Can't read xattr on %pd [%lu] (err %d)\n",
67 dentry, dentry->d_inode->i_ino, 67 dentry, d_backing_inode(dentry)->i_ino,
68 -ret); 68 -ret);
69 goto error; 69 goto error;
70 } 70 }
@@ -84,14 +84,14 @@ error:
84 84
85bad_type_length: 85bad_type_length:
86 pr_err("Cache object %lu type xattr length incorrect\n", 86 pr_err("Cache object %lu type xattr length incorrect\n",
87 dentry->d_inode->i_ino); 87 d_backing_inode(dentry)->i_ino);
88 ret = -EIO; 88 ret = -EIO;
89 goto error; 89 goto error;
90 90
91bad_type: 91bad_type:
92 xtype[2] = 0; 92 xtype[2] = 0;
93 pr_err("Cache object %pd [%lu] type %s not %s\n", 93 pr_err("Cache object %pd [%lu] type %s not %s\n",
94 dentry, dentry->d_inode->i_ino, 94 dentry, d_backing_inode(dentry)->i_ino,
95 xtype, type); 95 xtype, type);
96 ret = -EIO; 96 ret = -EIO;
97 goto error; 97 goto error;
@@ -165,7 +165,7 @@ int cachefiles_check_auxdata(struct cachefiles_object *object)
165 int ret; 165 int ret;
166 166
167 ASSERT(dentry); 167 ASSERT(dentry);
168 ASSERT(dentry->d_inode); 168 ASSERT(d_backing_inode(dentry));
169 ASSERT(object->fscache.cookie->def->check_aux); 169 ASSERT(object->fscache.cookie->def->check_aux);
170 170
171 auxbuf = kmalloc(sizeof(struct cachefiles_xattr) + 512, GFP_KERNEL); 171 auxbuf = kmalloc(sizeof(struct cachefiles_xattr) + 512, GFP_KERNEL);
@@ -204,7 +204,7 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object,
204 _enter("%p,#%d", object, auxdata->len); 204 _enter("%p,#%d", object, auxdata->len);
205 205
206 ASSERT(dentry); 206 ASSERT(dentry);
207 ASSERT(dentry->d_inode); 207 ASSERT(d_backing_inode(dentry));
208 208
209 auxbuf = kmalloc(sizeof(struct cachefiles_xattr) + 512, cachefiles_gfp); 209 auxbuf = kmalloc(sizeof(struct cachefiles_xattr) + 512, cachefiles_gfp);
210 if (!auxbuf) { 210 if (!auxbuf) {
@@ -225,7 +225,7 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object,
225 225
226 cachefiles_io_error_obj(object, 226 cachefiles_io_error_obj(object,
227 "Can't read xattr on %lu (err %d)", 227 "Can't read xattr on %lu (err %d)",
228 dentry->d_inode->i_ino, -ret); 228 d_backing_inode(dentry)->i_ino, -ret);
229 goto error; 229 goto error;
230 } 230 }
231 231
@@ -276,7 +276,7 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object,
276 cachefiles_io_error_obj(object, 276 cachefiles_io_error_obj(object,
277 "Can't update xattr on %lu" 277 "Can't update xattr on %lu"
278 " (error %d)", 278 " (error %d)",
279 dentry->d_inode->i_ino, -ret); 279 d_backing_inode(dentry)->i_ino, -ret);
280 goto error; 280 goto error;
281 } 281 }
282 } 282 }
@@ -291,7 +291,7 @@ error:
291 291
292bad_type_length: 292bad_type_length:
293 pr_err("Cache object %lu xattr length incorrect\n", 293 pr_err("Cache object %lu xattr length incorrect\n",
294 dentry->d_inode->i_ino); 294 d_backing_inode(dentry)->i_ino);
295 ret = -EIO; 295 ret = -EIO;
296 goto error; 296 goto error;
297 297
@@ -316,7 +316,7 @@ int cachefiles_remove_object_xattr(struct cachefiles_cache *cache,
316 cachefiles_io_error(cache, 316 cachefiles_io_error(cache,
317 "Can't remove xattr from %lu" 317 "Can't remove xattr from %lu"
318 " (error %d)", 318 " (error %d)",
319 dentry->d_inode->i_ino, -ret); 319 d_backing_inode(dentry)->i_ino, -ret);
320 } 320 }
321 321
322 _leave(" = %d", ret); 322 _leave(" = %d", ret);