aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/inode.c6
-rw-r--r--fs/ocfs2/inode.h7
-rw-r--r--fs/ocfs2/journal.c43
-rw-r--r--fs/ocfs2/journal.h9
-rw-r--r--fs/ocfs2/super.c2
5 files changed, 0 insertions, 67 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 16e8e74dc966..20e60e4b1f10 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -1067,12 +1067,6 @@ void ocfs2_clear_inode(struct inode *inode)
1067 mlog_bug_on_msg(oi->ip_open_count, 1067 mlog_bug_on_msg(oi->ip_open_count,
1068 "Clear inode of %llu has open count %d\n", 1068 "Clear inode of %llu has open count %d\n",
1069 (unsigned long long)oi->ip_blkno, oi->ip_open_count); 1069 (unsigned long long)oi->ip_blkno, oi->ip_open_count);
1070 mlog_bug_on_msg(!list_empty(&oi->ip_handle_list),
1071 "Clear inode of %llu has non empty handle list\n",
1072 (unsigned long long)oi->ip_blkno);
1073 mlog_bug_on_msg(oi->ip_handle,
1074 "Clear inode of %llu has non empty handle pointer\n",
1075 (unsigned long long)oi->ip_blkno);
1076 1070
1077 /* Clear all other flags. */ 1071 /* Clear all other flags. */
1078 oi->ip_flags = OCFS2_INODE_CACHE_INLINE; 1072 oi->ip_flags = OCFS2_INODE_CACHE_INLINE;
diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h
index 9957810fdf85..9b7354545cb4 100644
--- a/fs/ocfs2/inode.h
+++ b/fs/ocfs2/inode.h
@@ -48,13 +48,6 @@ struct ocfs2_inode_info
48 48
49 struct mutex ip_io_mutex; 49 struct mutex ip_io_mutex;
50 50
51 /* Used by the journalling code to attach an inode to a
52 * handle. These are protected by ip_io_mutex in order to lock
53 * out other I/O to the inode until we either commit or
54 * abort. */
55 struct list_head ip_handle_list;
56 struct ocfs2_journal_handle *ip_handle;
57
58 u32 ip_flags; /* see below */ 51 u32 ip_flags; /* see below */
59 u32 ip_attr; /* inode attributes */ 52 u32 ip_attr; /* inode attributes */
60 53
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index ca6f2094b006..f02af63e5fae 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -128,7 +128,6 @@ struct ocfs2_journal_handle *ocfs2_alloc_handle(struct ocfs2_super *osb)
128 retval->k_handle = NULL; 128 retval->k_handle = NULL;
129 129
130 INIT_LIST_HEAD(&retval->locks); 130 INIT_LIST_HEAD(&retval->locks);
131 INIT_LIST_HEAD(&retval->inode_list);
132 retval->journal = osb->journal; 131 retval->journal = osb->journal;
133 132
134 return retval; 133 return retval;
@@ -202,51 +201,12 @@ done_free:
202 return ERR_PTR(ret); 201 return ERR_PTR(ret);
203} 202}
204 203
205void ocfs2_handle_add_inode(struct ocfs2_journal_handle *handle,
206 struct inode *inode)
207{
208 BUG_ON(!handle);
209 BUG_ON(!inode);
210
211 atomic_inc(&inode->i_count);
212
213 /* we're obviously changing it... */
214 mutex_lock(&inode->i_mutex);
215
216 /* sanity check */
217 BUG_ON(OCFS2_I(inode)->ip_handle);
218 BUG_ON(!list_empty(&OCFS2_I(inode)->ip_handle_list));
219
220 OCFS2_I(inode)->ip_handle = handle;
221 list_move_tail(&(OCFS2_I(inode)->ip_handle_list), &(handle->inode_list));
222}
223
224static void ocfs2_handle_unlock_inodes(struct ocfs2_journal_handle *handle)
225{
226 struct list_head *p, *n;
227 struct inode *inode;
228 struct ocfs2_inode_info *oi;
229
230 list_for_each_safe(p, n, &handle->inode_list) {
231 oi = list_entry(p, struct ocfs2_inode_info,
232 ip_handle_list);
233 inode = &oi->vfs_inode;
234
235 OCFS2_I(inode)->ip_handle = NULL;
236 list_del_init(&OCFS2_I(inode)->ip_handle_list);
237
238 mutex_unlock(&inode->i_mutex);
239 iput(inode);
240 }
241}
242
243/* This is trivial so we do it out of the main commit 204/* This is trivial so we do it out of the main commit
244 * paths. Beware, it can be called from start_trans too! */ 205 * paths. Beware, it can be called from start_trans too! */
245static void ocfs2_commit_unstarted_handle(struct ocfs2_journal_handle *handle) 206static void ocfs2_commit_unstarted_handle(struct ocfs2_journal_handle *handle)
246{ 207{
247 mlog_entry_void(); 208 mlog_entry_void();
248 209
249 ocfs2_handle_unlock_inodes(handle);
250 /* You are allowed to add journal locks before the transaction 210 /* You are allowed to add journal locks before the transaction
251 * has started. */ 211 * has started. */
252 ocfs2_handle_cleanup_locks(handle->journal, handle); 212 ocfs2_handle_cleanup_locks(handle->journal, handle);
@@ -272,9 +232,6 @@ void ocfs2_commit_trans(struct ocfs2_journal_handle *handle)
272 return; 232 return;
273 } 233 }
274 234
275 /* release inode semaphores we took during this transaction */
276 ocfs2_handle_unlock_inodes(handle);
277
278 /* ocfs2_extend_trans may have had to call journal_restart 235 /* ocfs2_extend_trans may have had to call journal_restart
279 * which will always commit the transaction, but may return 236 * which will always commit the transaction, but may return
280 * error for any number of reasons. If this is the case, we 237 * error for any number of reasons. If this is the case, we
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 {
149 struct list_head locks; /* A bunch of locks to 149 struct list_head locks; /* A bunch of locks to
150 * release on commit. This 150 * release on commit. This
151 * should be a list_head */ 151 * should be a list_head */
152
153 struct list_head inode_list;
154}; 152};
155 153
156/* Exported only for the journal struct init code in super.c. Do not call. */ 154/* 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)
236 * ocfs2_handle_add_lock to indicate that a lock needs 234 * ocfs2_handle_add_lock to indicate that a lock needs
237 * to be released at the end of that handle. Locks 235 * to be released at the end of that handle. Locks
238 * will be released in the order that they are added. 236 * will be released in the order that they are added.
239 * ocfs2_handle_add_inode - Add a locked inode to a transaction.
240 */ 237 */
241 238
242/* You must always start_trans with a number of buffs > 0, but it's 239/* 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,
293 struct buffer_head *bh); 290 struct buffer_head *bh);
294int ocfs2_handle_add_lock(struct ocfs2_journal_handle *handle, 291int ocfs2_handle_add_lock(struct ocfs2_journal_handle *handle,
295 struct inode *inode); 292 struct inode *inode);
296/*
297 * Use this to protect from other processes reading buffer state while
298 * it's in flight.
299 */
300void ocfs2_handle_add_inode(struct ocfs2_journal_handle *handle,
301 struct inode *inode);
302 293
303/* 294/*
304 * Credit Macros: 295 * Credit Macros:
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 76b46ebbb10c..f3027c2fe2b6 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -914,9 +914,7 @@ static void ocfs2_inode_init_once(void *data,
914 oi->ip_open_count = 0; 914 oi->ip_open_count = 0;
915 spin_lock_init(&oi->ip_lock); 915 spin_lock_init(&oi->ip_lock);
916 ocfs2_extent_map_init(&oi->vfs_inode); 916 ocfs2_extent_map_init(&oi->vfs_inode);
917 INIT_LIST_HEAD(&oi->ip_handle_list);
918 INIT_LIST_HEAD(&oi->ip_io_markers); 917 INIT_LIST_HEAD(&oi->ip_io_markers);
919 oi->ip_handle = NULL;
920 oi->ip_created_trans = 0; 918 oi->ip_created_trans = 0;
921 oi->ip_last_trans = 0; 919 oi->ip_last_trans = 0;
922 oi->ip_dir_start_lookup = 0; 920 oi->ip_dir_start_lookup = 0;