aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cachefiles/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cachefiles/namei.c')
-rw-r--r--fs/cachefiles/namei.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
index 7f8e83f9d74e..d750e8cc0ab6 100644
--- a/fs/cachefiles/namei.c
+++ b/fs/cachefiles/namei.c
@@ -277,7 +277,7 @@ static int cachefiles_bury_object(struct cachefiles_cache *cache,
277 _debug("remove %p from %p", rep, dir); 277 _debug("remove %p from %p", rep, dir);
278 278
279 /* non-directories can just be unlinked */ 279 /* non-directories can just be unlinked */
280 if (!S_ISDIR(rep->d_inode->i_mode)) { 280 if (!d_is_dir(rep)) {
281 _debug("unlink stale object"); 281 _debug("unlink stale object");
282 282
283 path.mnt = cache->mnt; 283 path.mnt = cache->mnt;
@@ -323,7 +323,7 @@ try_again:
323 return 0; 323 return 0;
324 } 324 }
325 325
326 if (!S_ISDIR(cache->graveyard->d_inode->i_mode)) { 326 if (!d_is_dir(cache->graveyard)) {
327 unlock_rename(cache->graveyard, dir); 327 unlock_rename(cache->graveyard, dir);
328 cachefiles_io_error(cache, "Graveyard no longer a directory"); 328 cachefiles_io_error(cache, "Graveyard no longer a directory");
329 return -EIO; 329 return -EIO;
@@ -475,7 +475,7 @@ int cachefiles_walk_to_object(struct cachefiles_object *parent,
475 ASSERT(parent->dentry); 475 ASSERT(parent->dentry);
476 ASSERT(parent->dentry->d_inode); 476 ASSERT(parent->dentry->d_inode);
477 477
478 if (!(S_ISDIR(parent->dentry->d_inode->i_mode))) { 478 if (!(d_is_dir(parent->dentry))) {
479 // TODO: convert file to dir 479 // TODO: convert file to dir
480 _leave("looking up in none directory"); 480 _leave("looking up in none directory");
481 return -ENOBUFS; 481 return -ENOBUFS;
@@ -539,7 +539,7 @@ lookup_again:
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, next->d_inode, next->d_inode->i_ino);
541 541
542 } else if (!S_ISDIR(next->d_inode->i_mode)) { 542 } else if (!d_is_dir(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 next->d_inode->i_ino);
545 ret = -ENOBUFS; 545 ret = -ENOBUFS;
@@ -568,8 +568,8 @@ lookup_again:
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, next->d_inode, next->d_inode->i_ino);
570 570
571 } else if (!S_ISDIR(next->d_inode->i_mode) && 571 } else if (!d_is_dir(next) &&
572 !S_ISREG(next->d_inode->i_mode) 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 next->d_inode->i_ino);
@@ -642,7 +642,7 @@ lookup_again:
642 642
643 /* open a file interface onto a data file */ 643 /* open a file interface onto a data file */
644 if (object->type != FSCACHE_COOKIE_TYPE_INDEX) { 644 if (object->type != FSCACHE_COOKIE_TYPE_INDEX) {
645 if (S_ISREG(object->dentry->d_inode->i_mode)) { 645 if (d_is_reg(object->dentry)) {
646 const struct address_space_operations *aops; 646 const struct address_space_operations *aops;
647 647
648 ret = -EPERM; 648 ret = -EPERM;
@@ -763,7 +763,7 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
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(subdir->d_inode);
765 765
766 if (!S_ISDIR(subdir->d_inode->i_mode)) { 766 if (!d_is_dir(subdir)) {
767 pr_err("%s is not a directory\n", dirname); 767 pr_err("%s is not a directory\n", dirname);
768 ret = -EIO; 768 ret = -EIO;
769 goto check_error; 769 goto check_error;