summaryrefslogtreecommitdiff
path: root/include/linux/writeback.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r--include/linux/writeback.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 7b1ae2718f3e..5de884cd6a7c 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -72,4 +72,13 @@ extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
read-only. */
+/*
+ * Tell the writeback paths that they are being called for a "data integrity"
+ * operation such as fsync().
+ */
+static inline int called_for_sync(void)
+{
+ return current->flags & PF_SYNC;
+}
+
#endif /* WRITEBACK_H */