Whamcloud - gitweb
Add mds_fs_journal_data() method to enable data journaling on last_rcvd file.
authoradilger <adilger>
Mon, 22 Apr 2002 18:15:42 +0000 (18:15 +0000)
committeradilger <adilger>
Mon, 22 Apr 2002 18:15:42 +0000 (18:15 +0000)
lustre/include/linux/lustre_mds.h
lustre/mds/mds_ext2.c
lustre/mds/mds_ext3.c

index 84f7aed..8e017f4 100644 (file)
@@ -58,6 +58,29 @@ struct mds_update_record {
         __u64 ur_time;
 }; 
 
+#define MDS_LR_CLIENT  1024
+#define MDS_LR_SIZE     128
+
+#define MDS_MOUNT_RECOV 2
+
+/* Data stored per server at the head of the last_rcvd file */
+struct mds_server_data {
+        __u8 msd_uuid[37];      /* server UUID */
+        __u8 uuid_padding[3];   /* in case we decide to store UUIDs as ASCII */
+        __u64 msd_last_rcvd;    /* last completed transaction ID */
+        __u64 msd_mount_count;  /* MDS incarnation number */
+        __u8 padding[512 - 56];
+};
+
+/* Data stored per client in the last_rcvd file */
+struct mds_client_data {
+        __u8 mcd_uuid[37];      /* client UUID */
+        __u8 uuid_padding[3];   /* in case we decide to store UUIDs as ASCII */
+        __u64 mcd_last_rcvd;    /* last completed transaction ID */
+        __u64 mcd_mount_count;  /* MDS incarnation number */
+        __u8 padding[MDS_LR_SIZE - 56];
+};
+
 /* mds/mds_reint.c  */
 int mds_reint_rec(struct mds_update_record *r, struct ptlrpc_request *req); 
 
@@ -121,6 +144,7 @@ struct mds_fs_operations {
                                 loff_t *offset);
         void    (* fs_delete_inode)(struct inode *inode);
         void    (* cl_delete_inode)(struct inode *inode);
+        int     (* fs_journal_data)(struct inode *inode, struct file *file);
 };
 
 #define MDS_FSOP_UNLINK         1
@@ -130,6 +154,8 @@ struct mds_fs_operations {
 #define MDS_FSOP_MKDIR          5
 #define MDS_FSOP_SYMLINK        6
 #define MDS_FSOP_MKNOD          7
+#define MDS_FSOP_SETATTR        8
+#define MDS_FSOP_LINK           9
 
 static inline void *mds_fs_start(struct mds_obd *mds, struct inode *inode,
                                  int op)
@@ -174,6 +200,13 @@ static inline ssize_t mds_fs_readpage(struct mds_obd *mds, struct file *file,
         return mds->mds_fsops->fs_readpage(file, buf, count, offset);
 }
 
+static inline ssize_t mds_fs_journal_data(struct mds_obd *mds,
+                                          struct inode *inode,
+                                          struct file *file)
+{
+        return mds->mds_fsops->fs_journal_data(inode, file);
+}
+
 extern struct mds_fs_operations mds_ext2_fs_ops;
 extern struct mds_fs_operations mds_ext3_fs_ops;
 
index bd75fcd..e8b1e91 100644 (file)
@@ -91,6 +91,11 @@ void mds_ext2_delete_inode(struct inode *inode)
         mds_ext2_fs_ops.cl_delete_inode(inode);
 }
 
+int mds_ext2_journal_data(struct inode *inode, struct file *filp)
+{
+        return 0;
+}
+
 struct mds_fs_operations mds_ext2_fs_ops = {
         fs_start:       mds_ext2_start,
         fs_commit:      mds_ext2_stop,
@@ -100,4 +105,5 @@ struct mds_fs_operations mds_ext2_fs_ops = {
         fs_readpage:    mds_ext2_readpage,
         fs_delete_inode:mds_ext2_delete_inode,
         cl_delete_inode:clear_inode,
+        fs_journal_data:mds_ext2_journal_data,
 };
index 7ebd6a2..5ff07a7 100644 (file)
@@ -140,7 +140,7 @@ static ssize_t mds_ext3_readpage(struct file *file, char *buf, size_t count,
 
 struct mds_fs_operations mds_ext3_fs_ops;
 
-void mds_ext3_delete_inode(struct inode * inode)
+void mds_ext3_delete_inode(struct inode *inode)
 {
         void *handle;
 
@@ -164,6 +164,13 @@ void mds_ext3_delete_inode(struct inode * inode)
                 mds_ext3_fs_ops.cl_delete_inode(inode);
 }
 
+int mds_ext3_journal_data(struct inode *inode, struct file *filp)
+{
+        EXT3_I(inode)->i_flags |= EXT3_JOURNAL_DATA_FL;
+
+        return 0;
+}
+
 struct mds_fs_operations mds_ext3_fs_ops = {
         fs_start:       mds_ext3_start,
         fs_commit:      mds_ext3_commit,
@@ -173,4 +180,5 @@ struct mds_fs_operations mds_ext3_fs_ops = {
         fs_readpage:    mds_ext3_readpage,
         fs_delete_inode:mds_ext3_delete_inode,
         cl_delete_inode:clear_inode,
+        fs_journal_data:mds_ext3_journal_data,
 };