writeback: disassociate inodes from dying bdi_writebacks
[firefly-linux-kernel-4.4.55.git] / include / linux / backing-dev-defs.h
index e047b496a0b9e930c50ec3f72fe4f33e8480c1f8..a48d90e3bcbb86d98d911f21d248897c3c563730 100644 (file)
@@ -219,6 +219,17 @@ static inline void wb_put(struct bdi_writeback *wb)
                percpu_ref_put(&wb->refcnt);
 }
 
+/**
+ * wb_dying - is a wb dying?
+ * @wb: bdi_writeback of interest
+ *
+ * Returns whether @wb is unlinked and being drained.
+ */
+static inline bool wb_dying(struct bdi_writeback *wb)
+{
+       return percpu_ref_is_dying(&wb->refcnt);
+}
+
 #else  /* CONFIG_CGROUP_WRITEBACK */
 
 static inline bool wb_tryget(struct bdi_writeback *wb)
@@ -234,6 +245,11 @@ static inline void wb_put(struct bdi_writeback *wb)
 {
 }
 
+static inline bool wb_dying(struct bdi_writeback *wb)
+{
+       return false;
+}
+
 #endif /* CONFIG_CGROUP_WRITEBACK */
 
 #endif /* __LINUX_BACKING_DEV_DEFS_H */