diff options
-rw-r--r-- | drivers/staging/lustre/lustre/llite/dir.c | 5 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/llite/file.c | 13 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/llite/namei.c | 2 |
3 files changed, 9 insertions, 11 deletions
diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index fa639407fde7..a79fd65ec4c6 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c | |||
@@ -1389,7 +1389,7 @@ lmv_out_free: | |||
1389 | return -EFAULT; | 1389 | return -EFAULT; |
1390 | } | 1390 | } |
1391 | 1391 | ||
1392 | if (inode->i_sb->s_root == file->f_dentry) | 1392 | if (is_root_inode(inode)) |
1393 | set_default = 1; | 1393 | set_default = 1; |
1394 | 1394 | ||
1395 | /* in v1 and v3 cases lumv1 points to data */ | 1395 | /* in v1 and v3 cases lumv1 points to data */ |
@@ -1780,8 +1780,7 @@ out_quotactl: | |||
1780 | return ll_flush_ctx(inode); | 1780 | return ll_flush_ctx(inode); |
1781 | #ifdef CONFIG_FS_POSIX_ACL | 1781 | #ifdef CONFIG_FS_POSIX_ACL |
1782 | case LL_IOC_RMTACL: { | 1782 | case LL_IOC_RMTACL: { |
1783 | if (sbi->ll_flags & LL_SBI_RMT_CLIENT && | 1783 | if (sbi->ll_flags & LL_SBI_RMT_CLIENT && is_root_inode(inode)) { |
1784 | inode == inode->i_sb->s_root->d_inode) { | ||
1785 | struct ll_file_data *fd = LUSTRE_FPRIVATE(file); | 1784 | struct ll_file_data *fd = LUSTRE_FPRIVATE(file); |
1786 | 1785 | ||
1787 | LASSERT(fd != NULL); | 1786 | LASSERT(fd != NULL); |
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 567874fc5f47..37b7c93717a1 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c | |||
@@ -341,8 +341,7 @@ int ll_file_release(struct inode *inode, struct file *file) | |||
341 | inode->i_generation, inode); | 341 | inode->i_generation, inode); |
342 | 342 | ||
343 | #ifdef CONFIG_FS_POSIX_ACL | 343 | #ifdef CONFIG_FS_POSIX_ACL |
344 | if (sbi->ll_flags & LL_SBI_RMT_CLIENT && | 344 | if (sbi->ll_flags & LL_SBI_RMT_CLIENT && is_root_inode(inode)) { |
345 | inode == inode->i_sb->s_root->d_inode) { | ||
346 | struct ll_file_data *fd = LUSTRE_FPRIVATE(file); | 345 | struct ll_file_data *fd = LUSTRE_FPRIVATE(file); |
347 | 346 | ||
348 | LASSERT(fd != NULL); | 347 | LASSERT(fd != NULL); |
@@ -354,7 +353,7 @@ int ll_file_release(struct inode *inode, struct file *file) | |||
354 | } | 353 | } |
355 | #endif | 354 | #endif |
356 | 355 | ||
357 | if (inode->i_sb->s_root != file->f_dentry) | 356 | if (!is_root_inode(inode)) |
358 | ll_stats_ops_tally(sbi, LPROC_LL_RELEASE, 1); | 357 | ll_stats_ops_tally(sbi, LPROC_LL_RELEASE, 1); |
359 | fd = LUSTRE_FPRIVATE(file); | 358 | fd = LUSTRE_FPRIVATE(file); |
360 | LASSERT(fd != NULL); | 359 | LASSERT(fd != NULL); |
@@ -366,7 +365,7 @@ int ll_file_release(struct inode *inode, struct file *file) | |||
366 | lli->lli_opendir_pid != 0) | 365 | lli->lli_opendir_pid != 0) |
367 | ll_stop_statahead(inode, lli->lli_opendir_key); | 366 | ll_stop_statahead(inode, lli->lli_opendir_key); |
368 | 367 | ||
369 | if (inode->i_sb->s_root == file->f_dentry) { | 368 | if (is_root_inode(inode)) { |
370 | LUSTRE_FPRIVATE(file) = NULL; | 369 | LUSTRE_FPRIVATE(file) = NULL; |
371 | ll_file_data_put(fd); | 370 | ll_file_data_put(fd); |
372 | return 0; | 371 | return 0; |
@@ -562,7 +561,7 @@ int ll_file_open(struct inode *inode, struct file *file) | |||
562 | spin_unlock(&lli->lli_sa_lock); | 561 | spin_unlock(&lli->lli_sa_lock); |
563 | } | 562 | } |
564 | 563 | ||
565 | if (inode->i_sb->s_root == file->f_dentry) { | 564 | if (is_root_inode(inode)) { |
566 | LUSTRE_FPRIVATE(file) = fd; | 565 | LUSTRE_FPRIVATE(file) = fd; |
567 | return 0; | 566 | return 0; |
568 | } | 567 | } |
@@ -1636,7 +1635,7 @@ int ll_release_openhandle(struct inode *inode, struct lookup_intent *it) | |||
1636 | LASSERT(inode); | 1635 | LASSERT(inode); |
1637 | 1636 | ||
1638 | /* Root ? Do nothing. */ | 1637 | /* Root ? Do nothing. */ |
1639 | if (inode->i_sb->s_root->d_inode == inode) | 1638 | if (is_root_inode(inode)) |
1640 | return 0; | 1639 | return 0; |
1641 | 1640 | ||
1642 | /* No open handle to close? Move away */ | 1641 | /* No open handle to close? Move away */ |
@@ -3108,7 +3107,7 @@ int ll_inode_permission(struct inode *inode, int mask) | |||
3108 | /* as root inode are NOT getting validated in lookup operation, | 3107 | /* as root inode are NOT getting validated in lookup operation, |
3109 | * need to do it before permission check. */ | 3108 | * need to do it before permission check. */ |
3110 | 3109 | ||
3111 | if (inode == inode->i_sb->s_root->d_inode) { | 3110 | if (is_root_inode(inode)) { |
3112 | rc = __ll_inode_revalidate(inode->i_sb->s_root, | 3111 | rc = __ll_inode_revalidate(inode->i_sb->s_root, |
3113 | MDS_INODELOCK_LOOKUP); | 3112 | MDS_INODELOCK_LOOKUP); |
3114 | if (rc) | 3113 | if (rc) |
diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 02283c533f5b..8e926b385a60 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c | |||
@@ -264,7 +264,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, | |||
264 | 264 | ||
265 | if ((bits & (MDS_INODELOCK_LOOKUP | MDS_INODELOCK_PERM)) && | 265 | if ((bits & (MDS_INODELOCK_LOOKUP | MDS_INODELOCK_PERM)) && |
266 | inode->i_sb->s_root != NULL && | 266 | inode->i_sb->s_root != NULL && |
267 | inode != inode->i_sb->s_root->d_inode) | 267 | is_root_inode(inode)) |
268 | ll_invalidate_aliases(inode); | 268 | ll_invalidate_aliases(inode); |
269 | 269 | ||
270 | iput(inode); | 270 | iput(inode); |