]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
libxlog: add xlog_is_empty() helper
authorEric Sandeen <sandeen@sandeen.net>
Fri, 5 Jun 2015 02:15:04 +0000 (12:15 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 5 Jun 2015 02:15:04 +0000 (12:15 +1000)
commitf0873cea7453d0e04b836ddd344d729319bfeafc
treef06b4794512595612bc119d07536be0374d01c90
parentbb46491fb790dc1cd872b3b4b6198a63c9c0362f
libxlog: add xlog_is_empty() helper

xfs_repair and xfs_db both check for a dirty log, using roughly
the same cut and pasted code.

Add a new helper to do this, xlog_is_dirty(), and use it instead.

Note, the helper (and the code before it) is a little odd in that
it (re-)initializes some libxfs_init_t members before proceeding,
I haven't yet worked out if that's necessary or correct, so I've
just kept the same behavior for now.  Still, it seems like this
should be done in libxfs_init, or not at all.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/sb.c
include/libxlog.h
libxlog/util.c
repair/phase2.c