Commit 5b7b40f5 authored by Jeff Mahoney's avatar Jeff Mahoney Committed by Linus Torvalds

[PATCH] ReiserFS: Cleanup access of journal (cosmetic)

This patch cleans up fs/reiserfs/journal.c such that repeated uses of
SB_JOURNAL(p_s_sb) are removed in favor of a local journal variable.  The
compiler won't care, and it makes the code much easier to read.
Signed-off-by: default avatarJeff Mahoney <jeffm@novell.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c6c051f2
This diff is collapsed.
......@@ -399,7 +399,7 @@ static int show_journal(struct seq_file *m, struct super_block *sb)
DJP( jp_journal_trans_max ),
DJP( jp_journal_magic ),
DJP( jp_journal_max_batch ),
SB_JOURNAL_MAX_COMMIT_AGE(sb),
SB_JOURNAL(sb)->j_max_commit_age,
DJP( jp_journal_max_trans_age ),
JF( j_1st_reserved_block ),
......
......@@ -861,6 +861,7 @@ static int reiserfs_remount (struct super_block * s, int * mount_flags, char * a
unsigned long mount_options = REISERFS_SB(s)->s_mount_opt;
unsigned long safe_mask = 0;
unsigned int commit_max_age = (unsigned int)-1;
struct reiserfs_journal *journal = SB_JOURNAL(s);
rs = SB_DISK_SUPER_BLOCK (s);
......@@ -887,14 +888,14 @@ static int reiserfs_remount (struct super_block * s, int * mount_flags, char * a
REISERFS_SB(s)->s_mount_opt = (REISERFS_SB(s)->s_mount_opt & ~safe_mask) | (mount_options & safe_mask);
if(commit_max_age != 0 && commit_max_age != (unsigned int)-1) {
SB_JOURNAL_MAX_COMMIT_AGE(s) = commit_max_age;
SB_JOURNAL_MAX_TRANS_AGE(s) = commit_max_age;
journal->j_max_commit_age = commit_max_age;
journal->j_max_trans_age = commit_max_age;
}
else if(commit_max_age == 0)
{
/* 0 means restore defaults. */
SB_JOURNAL_MAX_COMMIT_AGE(s) = SB_JOURNAL_DEFAULT_MAX_COMMIT_AGE(s);
SB_JOURNAL_MAX_TRANS_AGE(s) = JOURNAL_MAX_TRANS_AGE;
journal->j_max_commit_age = journal->j_default_max_commit_age;
journal->j_max_trans_age = JOURNAL_MAX_TRANS_AGE;
}
if(blocks) {
......
......@@ -206,11 +206,11 @@ struct reiserfs_journal {
int j_cnode_used ; /* number of cnodes on the used list */
int j_cnode_free ; /* number of cnodes on the free list */
unsigned int s_journal_trans_max ; /* max number of blocks in a transaction. */
unsigned int s_journal_max_batch ; /* max number of blocks to batch into a trans */
unsigned int s_journal_max_commit_age ; /* in seconds, how old can an async commit be */
unsigned int s_journal_default_max_commit_age ; /* the default for the max commit age */
unsigned int s_journal_max_trans_age ; /* in seconds, how old can a transaction be */
unsigned int j_trans_max ; /* max number of blocks in a transaction. */
unsigned int j_max_batch ; /* max number of blocks to batch into a trans */
unsigned int j_max_commit_age ; /* in seconds, how old can an async commit be */
unsigned int j_max_trans_age ; /* in seconds, how old can a transaction be */
unsigned int j_default_max_commit_age ; /* the default for the max commit age */
struct reiserfs_journal_cnode *j_cnode_free_list ;
struct reiserfs_journal_cnode *j_cnode_free_orig ; /* orig pointer returned from vmalloc */
......@@ -494,12 +494,6 @@ int reiserfs_resize(struct super_block *, unsigned long) ;
#define SB_DISK_JOURNAL_HEAD(s) (SB_JOURNAL(s)->j_header_bh->)
#define SB_JOURNAL_TRANS_MAX(s) (SB_JOURNAL(s)->s_journal_trans_max)
#define SB_JOURNAL_MAX_BATCH(s) (SB_JOURNAL(s)->s_journal_max_batch)
#define SB_JOURNAL_MAX_COMMIT_AGE(s) (SB_JOURNAL(s)->s_journal_max_commit_age)
#define SB_JOURNAL_DEFAULT_MAX_COMMIT_AGE(s) (SB_JOURNAL(s)->s_journal_default_max_commit_age)
#define SB_JOURNAL_MAX_TRANS_AGE(s) (SB_JOURNAL(s)->s_journal_max_trans_age)
/* A safe version of the "bdevname", which returns the "s_id" field of
* a superblock or else "Null superblock" if the super block is NULL.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment