diff options
Diffstat (limited to 'fs/cachefiles/daemon.c')
| -rw-r--r-- | fs/cachefiles/daemon.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c index 72d4d0042826..727caedcdd92 100644 --- a/fs/cachefiles/daemon.c +++ b/fs/cachefiles/daemon.c | |||
| @@ -552,7 +552,6 @@ static int cachefiles_daemon_tag(struct cachefiles_cache *cache, char *args) | |||
| 552 | */ | 552 | */ |
| 553 | static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args) | 553 | static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args) |
| 554 | { | 554 | { |
| 555 | struct fs_struct *fs; | ||
| 556 | struct path path; | 555 | struct path path; |
| 557 | const struct cred *saved_cred; | 556 | const struct cred *saved_cred; |
| 558 | int ret; | 557 | int ret; |
| @@ -573,11 +572,7 @@ static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args) | |||
| 573 | } | 572 | } |
| 574 | 573 | ||
| 575 | /* extract the directory dentry from the cwd */ | 574 | /* extract the directory dentry from the cwd */ |
| 576 | fs = current->fs; | 575 | get_fs_pwd(current->fs, &path); |
| 577 | read_lock(&fs->lock); | ||
| 578 | path = fs->pwd; | ||
| 579 | path_get(&path); | ||
| 580 | read_unlock(&fs->lock); | ||
| 581 | 576 | ||
| 582 | if (!S_ISDIR(path.dentry->d_inode->i_mode)) | 577 | if (!S_ISDIR(path.dentry->d_inode->i_mode)) |
| 583 | goto notdir; | 578 | goto notdir; |
| @@ -629,7 +624,6 @@ inval: | |||
| 629 | */ | 624 | */ |
| 630 | static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args) | 625 | static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args) |
| 631 | { | 626 | { |
| 632 | struct fs_struct *fs; | ||
| 633 | struct path path; | 627 | struct path path; |
| 634 | const struct cred *saved_cred; | 628 | const struct cred *saved_cred; |
| 635 | int ret; | 629 | int ret; |
| @@ -650,11 +644,7 @@ static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args) | |||
| 650 | } | 644 | } |
| 651 | 645 | ||
| 652 | /* extract the directory dentry from the cwd */ | 646 | /* extract the directory dentry from the cwd */ |
| 653 | fs = current->fs; | 647 | get_fs_pwd(current->fs, &path); |
| 654 | read_lock(&fs->lock); | ||
| 655 | path = fs->pwd; | ||
| 656 | path_get(&path); | ||
| 657 | read_unlock(&fs->lock); | ||
| 658 | 648 | ||
| 659 | if (!S_ISDIR(path.dentry->d_inode->i_mode)) | 649 | if (!S_ISDIR(path.dentry->d_inode->i_mode)) |
| 660 | goto notdir; | 650 | goto notdir; |
