aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cachefiles
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cachefiles')
-rw-r--r--fs/cachefiles/daemon.c4
-rw-r--r--fs/cachefiles/namei.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c
index ce1b115dcc28..d92840209863 100644
--- a/fs/cachefiles/daemon.c
+++ b/fs/cachefiles/daemon.c
@@ -574,7 +574,7 @@ static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args)
574 /* extract the directory dentry from the cwd */ 574 /* extract the directory dentry from the cwd */
575 get_fs_pwd(current->fs, &path); 575 get_fs_pwd(current->fs, &path);
576 576
577 if (!S_ISDIR(path.dentry->d_inode->i_mode)) 577 if (!d_is_dir(path.dentry))
578 goto notdir; 578 goto notdir;
579 579
580 cachefiles_begin_secure(cache, &saved_cred); 580 cachefiles_begin_secure(cache, &saved_cred);
@@ -646,7 +646,7 @@ static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args)
646 /* extract the directory dentry from the cwd */ 646 /* extract the directory dentry from the cwd */
647 get_fs_pwd(current->fs, &path); 647 get_fs_pwd(current->fs, &path);
648 648
649 if (!S_ISDIR(path.dentry->d_inode->i_mode)) 649 if (!d_is_dir(path.dentry))
650 goto notdir; 650 goto notdir;
651 651
652 cachefiles_begin_secure(cache, &saved_cred); 652 cachefiles_begin_secure(cache, &saved_cred);
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;