diff options
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r-- | fs/ceph/super.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index c68e6a045fb9..7334ee86b9e8 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
@@ -474,6 +474,32 @@ static inline struct inode *ceph_find_inode(struct super_block *sb, | |||
474 | #define CEPH_I_CAP_DROPPED (1 << 8) /* caps were forcibly dropped */ | 474 | #define CEPH_I_CAP_DROPPED (1 << 8) /* caps were forcibly dropped */ |
475 | #define CEPH_I_KICK_FLUSH (1 << 9) /* kick flushing caps */ | 475 | #define CEPH_I_KICK_FLUSH (1 << 9) /* kick flushing caps */ |
476 | #define CEPH_I_FLUSH_SNAPS (1 << 10) /* need flush snapss */ | 476 | #define CEPH_I_FLUSH_SNAPS (1 << 10) /* need flush snapss */ |
477 | #define CEPH_I_ERROR_WRITE (1 << 11) /* have seen write errors */ | ||
478 | |||
479 | /* | ||
480 | * We set the ERROR_WRITE bit when we start seeing write errors on an inode | ||
481 | * and then clear it when they start succeeding. Note that we do a lockless | ||
482 | * check first, and only take the lock if it looks like it needs to be changed. | ||
483 | * The write submission code just takes this as a hint, so we're not too | ||
484 | * worried if a few slip through in either direction. | ||
485 | */ | ||
486 | static inline void ceph_set_error_write(struct ceph_inode_info *ci) | ||
487 | { | ||
488 | if (!(READ_ONCE(ci->i_ceph_flags) & CEPH_I_ERROR_WRITE)) { | ||
489 | spin_lock(&ci->i_ceph_lock); | ||
490 | ci->i_ceph_flags |= CEPH_I_ERROR_WRITE; | ||
491 | spin_unlock(&ci->i_ceph_lock); | ||
492 | } | ||
493 | } | ||
494 | |||
495 | static inline void ceph_clear_error_write(struct ceph_inode_info *ci) | ||
496 | { | ||
497 | if (READ_ONCE(ci->i_ceph_flags) & CEPH_I_ERROR_WRITE) { | ||
498 | spin_lock(&ci->i_ceph_lock); | ||
499 | ci->i_ceph_flags &= ~CEPH_I_ERROR_WRITE; | ||
500 | spin_unlock(&ci->i_ceph_lock); | ||
501 | } | ||
502 | } | ||
477 | 503 | ||
478 | static inline void __ceph_dir_set_complete(struct ceph_inode_info *ci, | 504 | static inline void __ceph_dir_set_complete(struct ceph_inode_info *ci, |
479 | long long release_count, | 505 | long long release_count, |