Skip to content

Commit 1c587ee

Browse files
committed
coredump: reflow dump helpers a little
They look rather messy right now. Link: https://lore.kernel.org/[email protected] Acked-by: Luca Boccassi <[email protected]> Reviewed-by: Jann Horn <[email protected]> Reviewed-by: Alexander Mikhalitsyn <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent d4fde20 commit 1c587ee

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

fs/coredump.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -864,10 +864,9 @@ static int __dump_emit(struct coredump_params *cprm, const void *addr, int nr)
864864
struct file *file = cprm->file;
865865
loff_t pos = file->f_pos;
866866
ssize_t n;
867+
867868
if (cprm->written + nr > cprm->limit)
868869
return 0;
869-
870-
871870
if (dump_interrupted())
872871
return 0;
873872
n = __kernel_write(file, addr, nr, &pos);
@@ -884,20 +883,21 @@ static int __dump_skip(struct coredump_params *cprm, size_t nr)
884883
{
885884
static char zeroes[PAGE_SIZE];
886885
struct file *file = cprm->file;
886+
887887
if (file->f_mode & FMODE_LSEEK) {
888-
if (dump_interrupted() ||
889-
vfs_llseek(file, nr, SEEK_CUR) < 0)
888+
if (dump_interrupted() || vfs_llseek(file, nr, SEEK_CUR) < 0)
890889
return 0;
891890
cprm->pos += nr;
892891
return 1;
893-
} else {
894-
while (nr > PAGE_SIZE) {
895-
if (!__dump_emit(cprm, zeroes, PAGE_SIZE))
896-
return 0;
897-
nr -= PAGE_SIZE;
898-
}
899-
return __dump_emit(cprm, zeroes, nr);
900892
}
893+
894+
while (nr > PAGE_SIZE) {
895+
if (!__dump_emit(cprm, zeroes, PAGE_SIZE))
896+
return 0;
897+
nr -= PAGE_SIZE;
898+
}
899+
900+
return __dump_emit(cprm, zeroes, nr);
901901
}
902902

903903
int dump_emit(struct coredump_params *cprm, const void *addr, int nr)

0 commit comments

Comments
 (0)