Whamcloud - gitweb
LU-14918 osd: don't declare similar ldiskfs writes twice
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_internal.h
index 1ee407e..6e8e962 100644 (file)
@@ -454,6 +454,11 @@ struct osd_thandle {
        ktime_t oth_started;
 #endif
        struct list_head        ot_trunc_locks;
+       /*
+        * list of declarations, used for large transactions to check
+        * for duplicates, like llogs
+        */
+       struct list_head        ot_declare_list;
 };
 
 /**
@@ -474,6 +479,13 @@ enum dt_txn_op {
         DTO_NR
 };
 
+struct osd_obj_declare {
+       struct list_head        old_list;
+       struct lu_fid           old_fid;
+       enum dt_txn_op          old_op;
+       loff_t                  old_pos;
+};
+
 /*
  * osd dev stats
  */
@@ -493,6 +505,7 @@ enum {
         LPROC_OSD_THANDLE_OPEN,
         LPROC_OSD_THANDLE_CLOSING,
 #endif
+       LPROC_OSD_TOO_MANY_CREDITS,
         LPROC_OSD_LAST,
 };
 #endif
@@ -1727,4 +1740,7 @@ static inline bool bdev_integrity_enabled(struct block_device *bdev, int rw)
        return false;
 }
 
+bool osd_tx_was_declared(const struct lu_env *env, struct osd_thandle *oth,
+                        struct dt_object *dt, enum dt_txn_op op, loff_t p);
+
 #endif /* _OSD_INTERNAL_H */