summaryrefslogtreecommitdiff
path: root/include/linux/jbd.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@zip.com.au>2002-07-04 08:31:50 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-07-04 08:31:50 -0700
commit8b00e4fac18298dce49b78d25c5ea2399aeb6fa2 (patch)
tree9adf44a270b94805e5d515d0381be29bc3a75399 /include/linux/jbd.h
parent66c1d66f7a9173e5102f7703dbc173db437ef788 (diff)
[PATCH] JBD commit callback capability
This is a patch which Stephen has applied to ext3's 2.4 repository. Originally written by Andreas, generalised somewhat by Stephen. Add jbd callback mechanism, requested for InterMezzo. We allow the jbd's client to request notification when a given handle's IO finally commits to disk, so that clients can manage their own writeback state asynchronously.
Diffstat (limited to 'include/linux/jbd.h')
-rw-r--r--include/linux/jbd.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 683c1247fd70..fafb868eec11 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -250,6 +250,13 @@ static inline struct journal_head *bh2jh(struct buffer_head *bh)
return bh->b_private;
}
+#define HAVE_JOURNAL_CALLBACK_STATUS
+struct journal_callback {
+ struct list_head jcb_list;
+ void (*jcb_func)(struct journal_callback *jcb, int error);
+ /* user data goes here */
+};
+
struct jbd_revoke_table_s;
/* The handle_t type represents a single atomic update being performed
@@ -280,6 +287,12 @@ struct handle_s
operations */
int h_err;
+ /* List of application registered callbacks for this handle.
+ * The function(s) will be called after the transaction that
+ * this handle is part of has been committed to disk.
+ */
+ struct list_head h_jcb;
+
/* Flags */
unsigned int h_sync: 1; /* sync-on-close */
unsigned int h_jdata: 1; /* force data journaling */
@@ -399,6 +412,10 @@ struct transaction_s
/* How many handles used this transaction? */
int t_handle_count;
+
+ /* List of registered callback functions for this transaction.
+ * Called when the transaction is committed. */
+ struct list_head t_jcb;
};
@@ -647,6 +664,9 @@ extern int journal_invalidatepage(journal_t *,
extern int journal_try_to_free_buffers(journal_t *, struct page *, int);
extern int journal_stop(handle_t *);
extern int journal_flush (journal_t *);
+extern void journal_callback_set(handle_t *handle,
+ void (*fn)(struct journal_callback *,int),
+ struct journal_callback *jcb);
extern void journal_lock_updates (journal_t *);
extern void journal_unlock_updates (journal_t *);