Whamcloud - gitweb
Ensure OST objids are unique even after a crash by using the mount count as
authoradilger <adilger>
Wed, 30 Jul 2003 20:35:06 +0000 (20:35 +0000)
committeradilger <adilger>
Wed, 30 Jul 2003 20:35:06 +0000 (20:35 +0000)
a generation number.  Remove old "superhack" code.

Add a "force_sync" parameter to filter_update_server_data() and
fsfilt_write_record() so that we ensure the mount_count is safe on disk
when the OST has started.

b=294
r=phil

lustre/include/linux/lustre_fsfilt.h
lustre/obdclass/fsfilt_ext3.c

index 72b2292..26895d9 100644 (file)
@@ -61,7 +61,8 @@ struct fsfilt_operations {
         int     (* fs_sync)(struct super_block *sb);
         int     (* fs_prep_san_write)(struct inode *inode, long *blocks,
                                       int nblocks, loff_t newsize);
-        int     (* fs_write_record)(struct file *, void *, int size, loff_t *);
+        int     (* fs_write_record)(struct file *, void *, int size, loff_t *,
+                                    int force_sync);
         int     (* fs_read_record)(struct file *, void *, int size, loff_t *);
 };
 
@@ -212,9 +213,10 @@ static inline int fsfilt_read_record(struct obd_device *obd, struct file *file,
 }
 
 static inline int fsfilt_write_record(struct obd_device *obd, struct file *file,
-                                      void *buf, loff_t size, loff_t *offs)
+                                      void *buf, loff_t size, loff_t *offs,
+                                      int force_sync)
 {
-        return obd->obd_fsops->fs_write_record(file, buf, size, offs);
+        return obd->obd_fsops->fs_write_record(file, buf, size,offs,force_sync);
 }
 
 #endif /* __KERNEL__ */
index eca44d0..55f14d4 100644 (file)
@@ -550,8 +550,8 @@ static int fsfilt_ext3_read_record(struct file * file, void *buf,
         return size;
 }
 
-static int fsfilt_ext3_write_record(struct file * file, void *buf,
-                                    int size, loff_t *offs)
+static int fsfilt_ext3_write_record(struct file *file, void *buf, int size,
+                                    loff_t *offs, int force_sync)
 {
         struct buffer_head *bh;
         unsigned long block, boffs;
@@ -610,6 +610,9 @@ static int fsfilt_ext3_write_record(struct file * file, void *buf,
                 goto out;
         }
         err = size;
+
+        if (force_sync)
+                handle->h_sync = 1; /* recovery likes this */
 out:
         if (bh)
                 brelse(bh);