diff options
author | Andreas Rohner <andreas.rohner@gmx.net> | 2014-04-03 17:50:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 19:21:25 -0400 |
commit | 90ccf7dde9527672553c3a809aa93654c95672d0 (patch) | |
tree | ddcd1f2972f5cb2a71eefb396e0c3d156d0647c6 | |
parent | e21269355eb18aa7be72d5dd92f421da0b50abdb (diff) |
nilfs2: add struct nilfs_suinfo_update and flags
Add the nilfs_suinfo_update structure, which contains the information
needed to update one segment usage entry. The flags specify, which
fields need to be updated.
Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net>
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>
-rw-r--r-- | include/linux/nilfs2_fs.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index 98755767c7b0..252657874a19 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
@@ -710,6 +710,48 @@ static inline int nilfs_suinfo_clean(const struct nilfs_suinfo *si) | |||
710 | } | 710 | } |
711 | 711 | ||
712 | /* ioctl */ | 712 | /* ioctl */ |
713 | /** | ||
714 | * nilfs_suinfo_update - segment usage information update | ||
715 | * @sup_segnum: segment number | ||
716 | * @sup_flags: flags for which fields are active in sup_sui | ||
717 | * @sup_reserved: reserved necessary for alignment | ||
718 | * @sup_sui: segment usage information | ||
719 | */ | ||
720 | struct nilfs_suinfo_update { | ||
721 | __u64 sup_segnum; | ||
722 | __u32 sup_flags; | ||
723 | __u32 sup_reserved; | ||
724 | struct nilfs_suinfo sup_sui; | ||
725 | }; | ||
726 | |||
727 | enum { | ||
728 | NILFS_SUINFO_UPDATE_LASTMOD, | ||
729 | NILFS_SUINFO_UPDATE_NBLOCKS, | ||
730 | NILFS_SUINFO_UPDATE_FLAGS, | ||
731 | __NR_NILFS_SUINFO_UPDATE_FIELDS, | ||
732 | }; | ||
733 | |||
734 | #define NILFS_SUINFO_UPDATE_FNS(flag, name) \ | ||
735 | static inline void \ | ||
736 | nilfs_suinfo_update_set_##name(struct nilfs_suinfo_update *sup) \ | ||
737 | { \ | ||
738 | sup->sup_flags |= 1UL << NILFS_SUINFO_UPDATE_##flag; \ | ||
739 | } \ | ||
740 | static inline void \ | ||
741 | nilfs_suinfo_update_clear_##name(struct nilfs_suinfo_update *sup) \ | ||
742 | { \ | ||
743 | sup->sup_flags &= ~(1UL << NILFS_SUINFO_UPDATE_##flag); \ | ||
744 | } \ | ||
745 | static inline int \ | ||
746 | nilfs_suinfo_update_##name(const struct nilfs_suinfo_update *sup) \ | ||
747 | { \ | ||
748 | return !!(sup->sup_flags & (1UL << NILFS_SUINFO_UPDATE_##flag));\ | ||
749 | } | ||
750 | |||
751 | NILFS_SUINFO_UPDATE_FNS(LASTMOD, lastmod) | ||
752 | NILFS_SUINFO_UPDATE_FNS(NBLOCKS, nblocks) | ||
753 | NILFS_SUINFO_UPDATE_FNS(FLAGS, flags) | ||
754 | |||
713 | enum { | 755 | enum { |
714 | NILFS_CHECKPOINT, | 756 | NILFS_CHECKPOINT, |
715 | NILFS_SNAPSHOT, | 757 | NILFS_SNAPSHOT, |