Skip to content

Commit

Permalink
reiserfs: rearrange journal abort
Browse files Browse the repository at this point in the history
This patch kills off reiserfs_journal_abort as it is never called, and
combines __reiserfs_journal_abort_{soft,hard} into one function called
reiserfs_abort_journal, which performs the same work. It is silent
as opposed to the old version, since the message was always issued
after a regular 'abort' message.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
jeffmahoney authored and torvalds committed Mar 30, 2009
1 parent c3a9c21 commit 32e8b10
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
23 changes: 4 additions & 19 deletions fs/reiserfs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -4295,14 +4295,15 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
return journal->j_errno;
}

static void __reiserfs_journal_abort_hard(struct super_block *sb)
/* Send the file system read only and refuse new transactions */
void reiserfs_abort_journal(struct super_block *sb, int errno)
{
struct reiserfs_journal *journal = SB_JOURNAL(sb);
if (test_bit(J_ABORTED, &journal->j_state))
return;

printk(KERN_CRIT "REISERFS: Aborting journal for filesystem on %s\n",
reiserfs_bdevname(sb));
if (!journal->j_errno)
journal->j_errno = errno;

sb->s_flags |= MS_RDONLY;
set_bit(J_ABORTED, &journal->j_state);
Expand All @@ -4312,19 +4313,3 @@ static void __reiserfs_journal_abort_hard(struct super_block *sb)
#endif
}

static void __reiserfs_journal_abort_soft(struct super_block *sb, int errno)
{
struct reiserfs_journal *journal = SB_JOURNAL(sb);
if (test_bit(J_ABORTED, &journal->j_state))
return;

if (!journal->j_errno)
journal->j_errno = errno;

__reiserfs_journal_abort_hard(sb);
}

void reiserfs_journal_abort(struct super_block *sb, int errno)
{
__reiserfs_journal_abort_soft(sb, errno);
}
2 changes: 1 addition & 1 deletion fs/reiserfs/prints.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...)
error_buf);

sb->s_flags |= MS_RDONLY;
reiserfs_journal_abort(sb, errno);
reiserfs_abort_journal(sb, errno);
}

/* this prints internal nodes (4 keys/items in line) (dc_number,
Expand Down
2 changes: 1 addition & 1 deletion include/linux/reiserfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,7 @@ int journal_begin(struct reiserfs_transaction_handle *,
struct super_block *p_s_sb, unsigned long);
int journal_join_abort(struct reiserfs_transaction_handle *,
struct super_block *p_s_sb, unsigned long);
void reiserfs_journal_abort(struct super_block *sb, int errno);
void reiserfs_abort_journal(struct super_block *sb, int errno);
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);
Expand Down

0 comments on commit 32e8b10

Please sign in to comment.