Skip to contentSkip to conversation

reiserfs: remove flush_old_commits

PATCH In review Jeff Mahoney 2 participants 2 messages Jun 17, 2013 – Jun 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reiserfs: remove flush_old_commits

Commit 033369d1 (reiserfs: get rid of resierfs_sync_super) was introduced to replace the old s->dirt method of superblock writeback. Reiserfs always journals the superblock on modification so we weren't really using it anyway.

It also introduced a bug that causes reiserfs_sync_fs to be called in 5 second intervals once sync is called, whether the file system needs it or not.

Let's just rip it all out. reiserfs_sync_fs has done the right thing for ages.

---
 fs/reiserfs/journal.c  |  4 ----
 fs/reiserfs/reiserfs.h |  6 ------
 fs/reiserfs/super.c    | 49 -------------------------------------------------
 3 files changed, 59 deletions(-)
fs/reiserfs/journal.c +0 -4
index 742fdd4..3b6b108 100644
@@ -1923,8 +1923,6 @@ static int do_journal_release(struct reiserfs_transaction_handle *th,
 	 * the workqueue job (flush_async_commit) needs this lock
 	 */
 	reiserfs_write_unlock(sb);
-
-	cancel_delayed_work_sync(&REISERFS_SB(sb)->old_work);
 	flush_workqueue(commit_wq);
 
 	if (!reiserfs_mounted_fs_count) {
@@ -3306,7 +3304,6 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
 		journal->j_first = cn;
 		journal->j_last = cn;
 	}
-	reiserfs_schedule_old_flush(sb);
 	return 0;
 }
 
@@ -3944,7 +3941,6 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
 	 ** it tells us if we should continue with the journal_end, or just return
 	 */
 	if (!check_journal_end(th, sb, nblocks, flags)) {
-		reiserfs_schedule_old_flush(sb);
 		wake_queued_writers(sb);
 		reiserfs_async_progress_wait(sb);
 		goto out;
fs/reiserfs/reiserfs.h +0 -6
index 157e474..055f512 100644
@@ -480,11 +480,6 @@ struct reiserfs_sb_info {
 	struct dentry *priv_root;	/* root of /.reiserfs_priv */
 	struct dentry *xattr_root;	/* root of /.reiserfs_priv/xattrs */
 	int j_errno;
-
-	int work_queued;              /* non-zero delayed work is queued */
-	struct delayed_work old_work; /* old transactions flush delayed work */
-	spinlock_t old_work_lock;     /* protects old_work and work_queued */
-
 #ifdef CONFIG_QUOTA
 	char *s_qf_names[MAXQUOTAS];
 	int s_jquota_fmt;
@@ -2493,7 +2488,6 @@ void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...);
 int reiserfs_allocate_list_bitmaps(struct super_block *s,
 				   struct reiserfs_list_bitmap *, unsigned int);
 
-void reiserfs_schedule_old_flush(struct super_block *s);
 void add_save_link(struct reiserfs_transaction_handle *th,
 		   struct inode *inode, int truncate);
 int remove_save_link(struct inode *inode, int truncate);
fs/reiserfs/super.c +0 -49

70 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · Jeff Mahoney <jeffm <at> suse.com> writes:

Commit 033369d1 (reiserfs: get rid of resierfs_sync_super) was introduced to replace the old s->dirt method of superblock writeback. Reiserfs always journals the superblock on modification so we weren't really using it anyway.

A bug with this patch is that uncommitted journal entries are left in memory so that if the machine is reset or loses power, you are guaranteed to lose data.