]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nilfs2/segment.h
nilfs2: simplify handling of active state of segments
[linux-2.6-omap-h63xx.git] / fs / nilfs2 / segment.h
index 615654b8c329602131ede34b19daaea355e49e8e..4a64eb82f1f56a3d71a06e330b2dbdd194cc6c17 100644 (file)
@@ -90,9 +90,11 @@ struct nilfs_segsum_pointer {
  * @sc_nblk_inc: Block count of current generation
  * @sc_dirty_files: List of files to be written
  * @sc_gc_inodes: List of GC inodes having blocks to be written
- * @sc_active_segments: List of active segments that were already written out
  * @sc_cleaning_segments: List of segments to be freed through construction
  * @sc_copied_buffers: List of copied buffers (buffer heads) to freeze data
+ * @sc_dsync_inode: inode whose data pages are written for a sync operation
+ * @sc_dsync_start: start byte offset of data pages
+ * @sc_dsync_end: end byte offset of data pages (inclusive)
  * @sc_segbufs: List of segment buffers
  * @sc_segbuf_nblocks: Number of available blocks in segment buffers.
  * @sc_curseg: Current segment buffer
@@ -105,7 +107,6 @@ struct nilfs_segsum_pointer {
  * @sc_nblk_this_inc: Number of blocks included in the current logical segment
  * @sc_seg_ctime: Creation time
  * @sc_flags: Internal flags
- * @sc_sketch_inode: Inode of the sketch file
  * @sc_state_lock: spinlock for sc_state and so on
  * @sc_state: Segctord state flags
  * @sc_flush_request: inode bitmap of metadata files to be flushed
@@ -130,10 +131,13 @@ struct nilfs_sc_info {
 
        struct list_head        sc_dirty_files;
        struct list_head        sc_gc_inodes;
-       struct list_head        sc_active_segments;
        struct list_head        sc_cleaning_segments;
        struct list_head        sc_copied_buffers;
 
+       struct nilfs_inode_info *sc_dsync_inode;
+       loff_t                  sc_dsync_start;
+       loff_t                  sc_dsync_end;
+
        /* Segment buffers */
        struct list_head        sc_segbufs;
        unsigned long           sc_segbuf_nblocks;
@@ -151,13 +155,6 @@ struct nilfs_sc_info {
 
        unsigned long           sc_flags;
 
-       /*
-        * Pointer to an inode of the sketch.
-        * This pointer is kept only while it contains data.
-        * We protect it with a semaphore of the segment constructor.
-        */
-       struct inode           *sc_sketch_inode;
-
        spinlock_t              sc_state_lock;
        unsigned long           sc_state;
        unsigned long           sc_flush_request;
@@ -186,6 +183,9 @@ enum {
        NILFS_SC_SUPER_ROOT,    /* The latest segment has a super root */
        NILFS_SC_PRIOR_FLUSH,   /* Requesting immediate flush without making a
                                   checkpoint */
+       NILFS_SC_HAVE_DELTA,    /* Next checkpoint will have update of files
+                                  other than DAT, cpfile, sufile, or files
+                                  moved by GC */
 };
 
 /* sc_state */
@@ -221,8 +221,8 @@ extern void nilfs_destroy_transaction_cache(void);
 extern void nilfs_relax_pressure_in_lock(struct super_block *);
 
 extern int nilfs_construct_segment(struct super_block *);
-extern int nilfs_construct_dsync_segment(struct super_block *,
-                                        struct inode *);
+extern int nilfs_construct_dsync_segment(struct super_block *, struct inode *,
+                                        loff_t, loff_t);
 extern void nilfs_flush_segment(struct super_block *, ino_t);
 extern int nilfs_clean_segments(struct super_block *, void __user *);
 
@@ -230,8 +230,7 @@ extern int nilfs_segctor_add_segments_to_be_freed(struct nilfs_sc_info *,
                                                  __u64 *, size_t);
 extern void nilfs_segctor_clear_segments_to_be_freed(struct nilfs_sc_info *);
 
-extern int nilfs_attach_segment_constructor(struct nilfs_sb_info *,
-                                           struct nilfs_recovery_info *);
+extern int nilfs_attach_segment_constructor(struct nilfs_sb_info *);
 extern void nilfs_detach_segment_constructor(struct nilfs_sb_info *);
 
 /* recovery.c */