nilfs2: extend nilfs_sustat ioctl struct

This adds a new argument to the nilfs_sustat structure.

The extended field allows to delete volatile active state of segments,
which was needed to protect freshly-created segments from garbage
collection but has confused code dealing with segments.  This
extension alleviates the mess and gives room for further
simplifications.

The volatile active flag is not persistent, so it's eliminable on this
occasion without affecting compatibility other than the ioctl change.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Ryusuke Konishi
2009-04-06 19:01:54 -07:00
committed by Linus Torvalds
parent 7a9461939a
commit 2c2e52fc4f
7 changed files with 41 additions and 75 deletions

View File

@ -565,8 +565,6 @@ enum {
NILFS_SEGMENT_USAGE_DIRTY,
NILFS_SEGMENT_USAGE_ERROR,
/* on-memory only */
NILFS_SEGMENT_USAGE_VOLATILE_ACTIVE,
/* ... */
};
@ -594,7 +592,6 @@ nilfs_segment_usage_##name(const struct nilfs_segment_usage *su) \
NILFS_SEGMENT_USAGE_FNS(ACTIVE, active)
NILFS_SEGMENT_USAGE_FNS(DIRTY, dirty)
NILFS_SEGMENT_USAGE_FNS(ERROR, error)
NILFS_SEGMENT_USAGE_FNS(VOLATILE_ACTIVE, volatile_active)
static inline void
nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su)
@ -650,7 +647,6 @@ nilfs_suinfo_##name(const struct nilfs_suinfo *si) \
NILFS_SUINFO_FNS(ACTIVE, active)
NILFS_SUINFO_FNS(DIRTY, dirty)
NILFS_SUINFO_FNS(ERROR, error)
NILFS_SUINFO_FNS(VOLATILE_ACTIVE, volatile_active)
static inline int nilfs_suinfo_clean(const struct nilfs_suinfo *si)
{
@ -717,8 +713,9 @@ struct nilfs_cpstat {
* @ss_nsegs: number of segments
* @ss_ncleansegs: number of clean segments
* @ss_ndirtysegs: number of dirty segments
* @ss_ctime:
* @ss_nongc_ctime:
* @ss_ctime: creation time of the last segment
* @ss_nongc_ctime: creation time of the last segment not for GC
* @ss_prot_seq: least sequence number of segments which must not be reclaimed
*/
struct nilfs_sustat {
__u64 ss_nsegs;
@ -726,6 +723,7 @@ struct nilfs_sustat {
__u64 ss_ndirtysegs;
__u64 ss_ctime;
__u64 ss_nongc_ctime;
__u64 ss_prot_seq;
};
/**