diff options
Diffstat (limited to 'fs/ceph/super.h')
| -rw-r--r-- | fs/ceph/super.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 01bf189e08a9..edcbf3774a56 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
| @@ -220,7 +220,7 @@ struct ceph_dentry_info { | |||
| 220 | * The locking for D_COMPLETE is a bit odd: | 220 | * The locking for D_COMPLETE is a bit odd: |
| 221 | * - we can clear it at almost any time (see ceph_d_prune) | 221 | * - we can clear it at almost any time (see ceph_d_prune) |
| 222 | * - it is only meaningful if: | 222 | * - it is only meaningful if: |
| 223 | * - we hold dir inode i_lock | 223 | * - we hold dir inode i_ceph_lock |
| 224 | * - we hold dir FILE_SHARED caps | 224 | * - we hold dir FILE_SHARED caps |
| 225 | * - the dentry D_COMPLETE is set | 225 | * - the dentry D_COMPLETE is set |
| 226 | */ | 226 | */ |
| @@ -250,6 +250,8 @@ struct ceph_inode_xattrs_info { | |||
| 250 | struct ceph_inode_info { | 250 | struct ceph_inode_info { |
| 251 | struct ceph_vino i_vino; /* ceph ino + snap */ | 251 | struct ceph_vino i_vino; /* ceph ino + snap */ |
| 252 | 252 | ||
| 253 | spinlock_t i_ceph_lock; | ||
| 254 | |||
| 253 | u64 i_version; | 255 | u64 i_version; |
| 254 | u32 i_time_warp_seq; | 256 | u32 i_time_warp_seq; |
| 255 | 257 | ||
| @@ -271,7 +273,7 @@ struct ceph_inode_info { | |||
| 271 | 273 | ||
| 272 | struct ceph_inode_xattrs_info i_xattrs; | 274 | struct ceph_inode_xattrs_info i_xattrs; |
| 273 | 275 | ||
| 274 | /* capabilities. protected _both_ by i_lock and cap->session's | 276 | /* capabilities. protected _both_ by i_ceph_lock and cap->session's |
| 275 | * s_mutex. */ | 277 | * s_mutex. */ |
| 276 | struct rb_root i_caps; /* cap list */ | 278 | struct rb_root i_caps; /* cap list */ |
| 277 | struct ceph_cap *i_auth_cap; /* authoritative cap, if any */ | 279 | struct ceph_cap *i_auth_cap; /* authoritative cap, if any */ |
| @@ -437,18 +439,18 @@ static inline void ceph_i_clear(struct inode *inode, unsigned mask) | |||
| 437 | { | 439 | { |
| 438 | struct ceph_inode_info *ci = ceph_inode(inode); | 440 | struct ceph_inode_info *ci = ceph_inode(inode); |
| 439 | 441 | ||
| 440 | spin_lock(&inode->i_lock); | 442 | spin_lock(&ci->i_ceph_lock); |
| 441 | ci->i_ceph_flags &= ~mask; | 443 | ci->i_ceph_flags &= ~mask; |
| 442 | spin_unlock(&inode->i_lock); | 444 | spin_unlock(&ci->i_ceph_lock); |
| 443 | } | 445 | } |
| 444 | 446 | ||
| 445 | static inline void ceph_i_set(struct inode *inode, unsigned mask) | 447 | static inline void ceph_i_set(struct inode *inode, unsigned mask) |
| 446 | { | 448 | { |
| 447 | struct ceph_inode_info *ci = ceph_inode(inode); | 449 | struct ceph_inode_info *ci = ceph_inode(inode); |
| 448 | 450 | ||
| 449 | spin_lock(&inode->i_lock); | 451 | spin_lock(&ci->i_ceph_lock); |
| 450 | ci->i_ceph_flags |= mask; | 452 | ci->i_ceph_flags |= mask; |
| 451 | spin_unlock(&inode->i_lock); | 453 | spin_unlock(&ci->i_ceph_lock); |
| 452 | } | 454 | } |
| 453 | 455 | ||
| 454 | static inline bool ceph_i_test(struct inode *inode, unsigned mask) | 456 | static inline bool ceph_i_test(struct inode *inode, unsigned mask) |
| @@ -456,9 +458,9 @@ static inline bool ceph_i_test(struct inode *inode, unsigned mask) | |||
| 456 | struct ceph_inode_info *ci = ceph_inode(inode); | 458 | struct ceph_inode_info *ci = ceph_inode(inode); |
| 457 | bool r; | 459 | bool r; |
| 458 | 460 | ||
| 459 | spin_lock(&inode->i_lock); | 461 | spin_lock(&ci->i_ceph_lock); |
| 460 | r = (ci->i_ceph_flags & mask) == mask; | 462 | r = (ci->i_ceph_flags & mask) == mask; |
| 461 | spin_unlock(&inode->i_lock); | 463 | spin_unlock(&ci->i_ceph_lock); |
| 462 | return r; | 464 | return r; |
| 463 | } | 465 | } |
| 464 | 466 | ||
| @@ -508,9 +510,9 @@ extern int __ceph_caps_issued_other(struct ceph_inode_info *ci, | |||
| 508 | static inline int ceph_caps_issued(struct ceph_inode_info *ci) | 510 | static inline int ceph_caps_issued(struct ceph_inode_info *ci) |
| 509 | { | 511 | { |
| 510 | int issued; | 512 | int issued; |
| 511 | spin_lock(&ci->vfs_inode.i_lock); | 513 | spin_lock(&ci->i_ceph_lock); |
| 512 | issued = __ceph_caps_issued(ci, NULL); | 514 | issued = __ceph_caps_issued(ci, NULL); |
| 513 | spin_unlock(&ci->vfs_inode.i_lock); | 515 | spin_unlock(&ci->i_ceph_lock); |
| 514 | return issued; | 516 | return issued; |
| 515 | } | 517 | } |
| 516 | 518 | ||
| @@ -518,9 +520,9 @@ static inline int ceph_caps_issued_mask(struct ceph_inode_info *ci, int mask, | |||
| 518 | int touch) | 520 | int touch) |
| 519 | { | 521 | { |
| 520 | int r; | 522 | int r; |
| 521 | spin_lock(&ci->vfs_inode.i_lock); | 523 | spin_lock(&ci->i_ceph_lock); |
| 522 | r = __ceph_caps_issued_mask(ci, mask, touch); | 524 | r = __ceph_caps_issued_mask(ci, mask, touch); |
| 523 | spin_unlock(&ci->vfs_inode.i_lock); | 525 | spin_unlock(&ci->i_ceph_lock); |
| 524 | return r; | 526 | return r; |
| 525 | } | 527 | } |
| 526 | 528 | ||
| @@ -743,10 +745,9 @@ extern int ceph_add_cap(struct inode *inode, | |||
| 743 | extern void __ceph_remove_cap(struct ceph_cap *cap); | 745 | extern void __ceph_remove_cap(struct ceph_cap *cap); |
| 744 | static inline void ceph_remove_cap(struct ceph_cap *cap) | 746 | static inline void ceph_remove_cap(struct ceph_cap *cap) |
| 745 | { | 747 | { |
| 746 | struct inode *inode = &cap->ci->vfs_inode; | 748 | spin_lock(&cap->ci->i_ceph_lock); |
| 747 | spin_lock(&inode->i_lock); | ||
| 748 | __ceph_remove_cap(cap); | 749 | __ceph_remove_cap(cap); |
| 749 | spin_unlock(&inode->i_lock); | 750 | spin_unlock(&cap->ci->i_ceph_lock); |
| 750 | } | 751 | } |
| 751 | extern void ceph_put_cap(struct ceph_mds_client *mdsc, | 752 | extern void ceph_put_cap(struct ceph_mds_client *mdsc, |
| 752 | struct ceph_cap *cap); | 753 | struct ceph_cap *cap); |
