Whamcloud - gitweb
- initialize transaction table if needed
authortappro <tappro>
Tue, 7 Oct 2008 11:47:56 +0000 (11:47 +0000)
committertappro <tappro>
Tue, 7 Oct 2008 11:47:56 +0000 (11:47 +0000)
  b:17174
  i:bzzz, adilger

lustre/obdclass/target.c

index 11bc5d8..e3b3df6 100644 (file)
 #include <obd.h>
 
 /**
+ * Initialize trans_table if it is not initialized yet
+ */
+void target_trans_table_init(struct obd_device *obd)
+{
+        struct lr_server_data *lsd = obd->u.obt.obt_lsd;
+        /** new export or from 1.6 fs */
+        if (le32_to_cpu(lsd->lsd_trans_table_time) == 0)
+                lsd->lsd_trans_table_time = cpu_to_le32(cfs_time_current_sec());
+        /** number of interval changed, write new value */
+        if (le32_to_cpu(lsd->lsd_expire_intervals) == 0)
+                lsd->lsd_expire_intervals = cpu_to_le32(LR_EXPIRE_INTERVALS);
+}
+EXPORT_SYMBOL(target_trans_table_init);
+
+/**
  * Calculate time by index. All expiration time is divided by LR_EXPIRE_INTERVALS,
  * so time of each index is calculated from time of first index
  */