OSDN Git Service

xfs: add log attributes for log lsn and grant head data
authorBrian Foster <bfoster@redhat.com>
Mon, 14 Jul 2014 22:07:48 +0000 (08:07 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 14 Jul 2014 22:07:48 +0000 (08:07 +1000)
commit80d6d69821a27c3cd4687c2eefe409cbd1b7f458
treed28f9bc82bf793fd1c0152ab82f4d6db12e9d102
parentbaff4e44b92aad363dcce176b907a369ee8b348e
xfs: add log attributes for log lsn and grant head data

Create log attributes to export the current runtime state of the log to
sysfs. Note that the filesystem should be frozen for consistency across
attributes.

The following per-mount attributes are created: log_head_lsn,
log_tail_lsn, reserve_grant_head and write_grant_head. These represent
the physical log head, tail and reserve and write grant heads
respectively. Attribute values are exported in the following format:

"cycle:[block,byte]"

... where cycle represents the log cycle and [block,bytes] represents
either the basic block or byte offset of the log, depending on the
attribute.  Log sequence number (LSN) values are encoded in basic blocks
and grant heads are encoded in bytes. All values are in decimal format.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_sysfs.c