Skip to content

Commit c67d859

Browse files
committed
ext4: clean up ext4_abort() so __func__ is now implicit
Use a macro definition for ext4_abort() to clean up the .c files a wee bit. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent 4a9cdec commit c67d859

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎fs/ext4/ext4.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1629,8 +1629,10 @@ extern void ext4_error_inode(const char *, struct inode *, const char *, ...)
16291629
extern void ext4_error_file(const char *, struct file *, const char *, ...)
16301630
__attribute__ ((format (printf, 3, 4)));
16311631
extern void __ext4_std_error(struct super_block *, const char *, int);
1632-
extern void ext4_abort(struct super_block *, const char *, const char *, ...)
1632+
extern void __ext4_abort(struct super_block *, const char *, const char *, ...)
16331633
__attribute__ ((format (printf, 3, 4)));
1634+
#define ext4_abort(sb, message...) __ext4_abort(sb, __func__, \
1635+
## message)
16341636
extern void __ext4_warning(struct super_block *, const char *,
16351637
const char *, ...)
16361638
__attribute__ ((format (printf, 3, 4)));

‎fs/ext4/ext4_jbd2.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ int __ext4_forget(const char *where, handle_t *handle, int is_metadata,
9393
err = jbd2_journal_revoke(handle, blocknr, bh);
9494
if (err) {
9595
ext4_journal_abort_handle(where, __func__, bh, handle, err);
96-
ext4_abort(inode->i_sb, __func__,
97-
"error %d when attempting revoke", err);
96+
__ext4_abort(inode->i_sb, where,
97+
"error %d when attempting revoke", err);
9898
}
9999
BUFFER_TRACE(bh, "exit");
100100
return err;

‎fs/ext4/super.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks)
248248
journal = EXT4_SB(sb)->s_journal;
249249
if (journal) {
250250
if (is_journal_aborted(journal)) {
251-
ext4_abort(sb, __func__, "Detected aborted journal");
251+
ext4_abort(sb, "Detected aborted journal");
252252
return ERR_PTR(-EROFS);
253253
}
254254
return jbd2_journal_start(journal, nblocks);
@@ -464,8 +464,8 @@ void __ext4_std_error(struct super_block *sb, const char *function, int errno)
464464
* case we take the easy way out and panic immediately.
465465
*/
466466

467-
void ext4_abort(struct super_block *sb, const char *function,
468-
const char *fmt, ...)
467+
void __ext4_abort(struct super_block *sb, const char *function,
468+
const char *fmt, ...)
469469
{
470470
va_list args;
471471

@@ -660,8 +660,7 @@ static void ext4_put_super(struct super_block *sb)
660660
err = jbd2_journal_destroy(sbi->s_journal);
661661
sbi->s_journal = NULL;
662662
if (err < 0)
663-
ext4_abort(sb, __func__,
664-
"Couldn't clean up the journal");
663+
ext4_abort(sb, "Couldn't clean up the journal");
665664
}
666665

667666
ext4_release_system_zone(sb);
@@ -3605,7 +3604,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
36053604
}
36063605

36073606
if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED)
3608-
ext4_abort(sb, __func__, "Abort forced by user");
3607+
ext4_abort(sb, "Abort forced by user");
36093608

36103609
sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
36113610
(test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0);

0 commit comments

Comments
 (0)