From 01ddf1e186b3b12b38c9e44912e0fd6a1cbc882b Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Thu, 5 Oct 2006 13:54:39 -0700 Subject: ocfs2: remove unused ocfs2_journal_handle field max_buffs was just being set and not actually used. Signed-off-by: Mark Fasheh --- fs/ocfs2/journal.h | 1 - 1 file changed, 1 deletion(-) (limited to 'fs/ocfs2/journal.h') diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 2f3a6acdac45..35ae835e9698 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -144,7 +144,6 @@ struct ocfs2_journal_handle { handle_t *k_handle; /* kernel handle. */ struct ocfs2_journal *journal; u32 flags; /* see flags below. */ - int max_buffs; /* Buffs reserved by this handle */ /* The following two fields are for ocfs2_handle_add_lock */ int num_locks; -- cgit v1.2.2 From 1fc581467e52546195c7ee8233a34d63c1cc1322 Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Thu, 5 Oct 2006 14:15:36 -0700 Subject: ocfs2: have ocfs2_extend_trans() take handle_t No reason to use our wrapper struct in this function, so take the handle_t directly. Also fixes a bug where we were incorrectly setting the handle to NULL in case of a failure from journal_restart() Signed-off-by: Mark Fasheh --- fs/ocfs2/journal.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fs/ocfs2/journal.h') diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 35ae835e9698..9f3d79dac33b 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -264,8 +264,7 @@ struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb, struct ocfs2_journal_handle *handle, int max_buffs); void ocfs2_commit_trans(struct ocfs2_journal_handle *handle); -int ocfs2_extend_trans(struct ocfs2_journal_handle *handle, - int nblocks); +int ocfs2_extend_trans(handle_t *handle, int nblocks); /* * Create access is for when we get a newly created buffer and we're -- cgit v1.2.2 From c161f89be7d57af863e434e9b15afaa863343a7a Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Thu, 5 Oct 2006 15:11:36 -0700 Subject: ocfs2: remove ocfs2_journal_handle flags field Callers can set h_sync directly on the handle_t, whether a transaction has been started or not can be determined via the existence of the handle_t on the struct ocfs2_journal_handle. Signed-off-by: Mark Fasheh --- fs/ocfs2/journal.h | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'fs/ocfs2/journal.h') diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 9f3d79dac33b..6b5d548ca117 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -143,7 +143,6 @@ struct ocfs2_journal_lock { struct ocfs2_journal_handle { handle_t *k_handle; /* kernel handle. */ struct ocfs2_journal *journal; - u32 flags; /* see flags below. */ /* The following two fields are for ocfs2_handle_add_lock */ int num_locks; @@ -154,22 +153,6 @@ struct ocfs2_journal_handle { struct list_head inode_list; }; -#define OCFS2_HANDLE_STARTED 1 -/* should we sync-commit this handle? */ -#define OCFS2_HANDLE_SYNC 2 -static inline int ocfs2_handle_started(struct ocfs2_journal_handle *handle) -{ - return handle->flags & OCFS2_HANDLE_STARTED; -} - -static inline void ocfs2_handle_set_sync(struct ocfs2_journal_handle *handle, int sync) -{ - if (sync) - handle->flags |= OCFS2_HANDLE_SYNC; - else - handle->flags &= ~OCFS2_HANDLE_SYNC; -} - /* Exported only for the journal struct init code in super.c. Do not call. */ void ocfs2_complete_recovery(void *data); -- cgit v1.2.2 From 02928a71ae6da6e3e205d99e1fa1a1f598ddb62d Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Fri, 6 Oct 2006 18:51:46 -0700 Subject: ocfs2: remove unused ocfs2_handle_add_inode() We can also delete the unused infrastructure which was once in place to support this functionality. ocfs2_inode_private loses ip_handle and ip_handle_list. ocfs2_journal_handle loses handle_list. Signed-off-by: Mark Fasheh --- fs/ocfs2/journal.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'fs/ocfs2/journal.h') diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 6b5d548ca117..3a16d7d88e1c 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -149,8 +149,6 @@ struct ocfs2_journal_handle { struct list_head locks; /* A bunch of locks to * release on commit. This * should be a list_head */ - - struct list_head inode_list; }; /* Exported only for the journal struct init code in super.c. Do not call. */ @@ -236,7 +234,6 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) * ocfs2_handle_add_lock to indicate that a lock needs * to be released at the end of that handle. Locks * will be released in the order that they are added. - * ocfs2_handle_add_inode - Add a locked inode to a transaction. */ /* You must always start_trans with a number of buffs > 0, but it's @@ -293,12 +290,6 @@ int ocfs2_journal_dirty_data(handle_t *handle, struct buffer_head *bh); int ocfs2_handle_add_lock(struct ocfs2_journal_handle *handle, struct inode *inode); -/* - * Use this to protect from other processes reading buffer state while - * it's in flight. - */ -void ocfs2_handle_add_inode(struct ocfs2_journal_handle *handle, - struct inode *inode); /* * Credit Macros: -- cgit v1.2.2 From daf29e9cdab7219838c6b6e82380aec3466cf379 Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Fri, 6 Oct 2006 19:05:31 -0700 Subject: ocfs2: remove unused ocfs2_handle_add_lock() This gets us rid of a slab we no longer need, as well as removing the majority of what's left on ocfs2_journal_handle. ocfs2_commit_unstarted_handle() has no more real work to do, so remove that function too. Signed-off-by: Mark Fasheh --- fs/ocfs2/journal.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'fs/ocfs2/journal.h') diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 3a16d7d88e1c..7e9c1303d633 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -133,22 +133,9 @@ static inline void ocfs2_inode_set_new(struct ocfs2_super *osb, spin_unlock(&trans_inc_lock); } -extern kmem_cache_t *ocfs2_lock_cache; - -struct ocfs2_journal_lock { - struct inode *jl_inode; - struct list_head jl_lock_list; -}; - struct ocfs2_journal_handle { handle_t *k_handle; /* kernel handle. */ struct ocfs2_journal *journal; - - /* The following two fields are for ocfs2_handle_add_lock */ - int num_locks; - struct list_head locks; /* A bunch of locks to - * release on commit. This - * should be a list_head */ }; /* Exported only for the journal struct init code in super.c. Do not call. */ @@ -229,11 +216,6 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) * ocfs2_journal_dirty - Mark a journalled buffer as having dirty data. * ocfs2_journal_dirty_data - Indicate that a data buffer should go out before * the current handle commits. - * ocfs2_handle_add_lock - Sometimes we need to delay lock release - * until after a transaction has been completed. Use - * ocfs2_handle_add_lock to indicate that a lock needs - * to be released at the end of that handle. Locks - * will be released in the order that they are added. */ /* You must always start_trans with a number of buffs > 0, but it's @@ -288,8 +270,6 @@ int ocfs2_journal_dirty(struct ocfs2_journal_handle *handle, struct buffer_head *bh); int ocfs2_journal_dirty_data(handle_t *handle, struct buffer_head *bh); -int ocfs2_handle_add_lock(struct ocfs2_journal_handle *handle, - struct inode *inode); /* * Credit Macros: -- cgit v1.2.2 From a301a27d715276a71827004549bcbb2b64776c11 Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Fri, 6 Oct 2006 19:07:43 -0700 Subject: ocfs2: make ocfs2_alloc_handle() static This is no longer used outside of journal.c Signed-off-by: Mark Fasheh --- fs/ocfs2/journal.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'fs/ocfs2/journal.h') diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 7e9c1303d633..3e64e6b646a9 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -198,11 +198,6 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) * Transaction Handling: * Manage the lifetime of a transaction handle. * - * ocfs2_alloc_handle - Only allocate a handle so we can start putting - * cluster locks on it. To actually change blocks, - * call ocfs2_start_trans with the handle returned - * from this function. You may call ocfs2_commit_trans - * at any time in the lifetime of a handle. * ocfs2_start_trans - Begin a transaction. Give it an upper estimate of * the number of blocks that will be changed during * this handle. @@ -221,7 +216,6 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) /* You must always start_trans with a number of buffs > 0, but it's * perfectly legal to go through an entire transaction without having * dirtied any buffers. */ -struct ocfs2_journal_handle *ocfs2_alloc_handle(struct ocfs2_super *osb); struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb, struct ocfs2_journal_handle *handle, int max_buffs); -- cgit v1.2.2 From 02dc1af44e9fa4b8801169891b3a1ba4047537ad Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Mon, 9 Oct 2006 16:48:10 -0700 Subject: ocfs2: pass ocfs2_super * into ocfs2_commit_trans() This sets us up to remove handle->journal. Signed-off-by: Mark Fasheh --- fs/ocfs2/journal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/ocfs2/journal.h') diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 3e64e6b646a9..d315179d0c07 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -219,7 +219,8 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb, struct ocfs2_journal_handle *handle, int max_buffs); -void ocfs2_commit_trans(struct ocfs2_journal_handle *handle); +void ocfs2_commit_trans(struct ocfs2_super *osb, + struct ocfs2_journal_handle *handle); int ocfs2_extend_trans(handle_t *handle, int nblocks); /* -- cgit v1.2.2 From dae85832ffe2879b57b23aea319a0ec17667898d Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Mon, 9 Oct 2006 16:50:32 -0700 Subject: ocfs2: remove ocfs2_journal_handle journal field It is no longer used. Signed-off-by: Mark Fasheh --- fs/ocfs2/journal.h | 1 - 1 file changed, 1 deletion(-) (limited to 'fs/ocfs2/journal.h') diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index d315179d0c07..d96f61abd668 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -135,7 +135,6 @@ static inline void ocfs2_inode_set_new(struct ocfs2_super *osb, struct ocfs2_journal_handle { handle_t *k_handle; /* kernel handle. */ - struct ocfs2_journal *journal; }; /* Exported only for the journal struct init code in super.c. Do not call. */ -- cgit v1.2.2 From 65eff9ccf86d63eb5c3e9071450a36e4e4fa9564 Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Mon, 9 Oct 2006 17:26:22 -0700 Subject: ocfs2: remove handle argument to ocfs2_start_trans() All callers either pass in NULL directly, or a local variable that is already set to NULL. The internals of ocfs2_start_trans() get a nice cleanup as a result. Signed-off-by: Mark Fasheh --- fs/ocfs2/journal.h | 1 - 1 file changed, 1 deletion(-) (limited to 'fs/ocfs2/journal.h') diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index d96f61abd668..3c0d15c5e49c 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -216,7 +216,6 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) * perfectly legal to go through an entire transaction without having * dirtied any buffers. */ struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb, - struct ocfs2_journal_handle *handle, int max_buffs); void ocfs2_commit_trans(struct ocfs2_super *osb, struct ocfs2_journal_handle *handle); -- cgit v1.2.2 From 1fabe1481fac9e01bf8bffa60a2307ef379aa5de Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Mon, 9 Oct 2006 18:11:45 -0700 Subject: ocfs2: Remove struct ocfs2_journal_handle in favor of handle_t This is mostly a search and replace as ocfs2_journal_handle is now no more than a container for a handle_t pointer. ocfs2_commit_trans() becomes very straight forward, and we remove some out of date comments / code. Signed-off-by: Mark Fasheh --- fs/ocfs2/journal.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'fs/ocfs2/journal.h') diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 3c0d15c5e49c..d86cb960b7ec 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -37,7 +37,6 @@ enum ocfs2_journal_state { struct ocfs2_super; struct ocfs2_dinode; -struct ocfs2_journal_handle; struct ocfs2_journal { enum ocfs2_journal_state j_state; /* Journals current state */ @@ -133,10 +132,6 @@ static inline void ocfs2_inode_set_new(struct ocfs2_super *osb, spin_unlock(&trans_inc_lock); } -struct ocfs2_journal_handle { - handle_t *k_handle; /* kernel handle. */ -}; - /* Exported only for the journal struct init code in super.c. Do not call. */ void ocfs2_complete_recovery(void *data); @@ -200,7 +195,11 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) * ocfs2_start_trans - Begin a transaction. Give it an upper estimate of * the number of blocks that will be changed during * this handle. - * ocfs2_commit_trans - Complete a handle. + * ocfs2_commit_trans - Complete a handle. It might return -EIO if + * the journal was aborted. The majority of paths don't + * check the return value as an error there comes too + * late to do anything (and will be picked up in a + * later transaction). * ocfs2_extend_trans - Extend a handle by nblocks credits. This may * commit the handle to disk in the process, but will * not release any locks taken during the transaction. @@ -215,10 +214,10 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) /* You must always start_trans with a number of buffs > 0, but it's * perfectly legal to go through an entire transaction without having * dirtied any buffers. */ -struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb, +handle_t *ocfs2_start_trans(struct ocfs2_super *osb, int max_buffs); -void ocfs2_commit_trans(struct ocfs2_super *osb, - struct ocfs2_journal_handle *handle); +int ocfs2_commit_trans(struct ocfs2_super *osb, + handle_t *handle); int ocfs2_extend_trans(handle_t *handle, int nblocks); /* @@ -236,7 +235,7 @@ int ocfs2_extend_trans(handle_t *handle, int nblocks); #define OCFS2_JOURNAL_ACCESS_WRITE 1 #define OCFS2_JOURNAL_ACCESS_UNDO 2 -int ocfs2_journal_access(struct ocfs2_journal_handle *handle, +int ocfs2_journal_access(handle_t *handle, struct inode *inode, struct buffer_head *bh, int type); @@ -259,7 +258,7 @@ int ocfs2_journal_access(struct ocfs2_journal_handle *handle, * * ocfs2_journal_dirty(handle, bh); */ -int ocfs2_journal_dirty(struct ocfs2_journal_handle *handle, +int ocfs2_journal_dirty(handle_t *handle, struct buffer_head *bh); int ocfs2_journal_dirty_data(handle_t *handle, struct buffer_head *bh); -- cgit v1.2.2