Whamcloud - gitweb
LU-2482 layout: introduce new layout for released files
[fs/lustre-release.git] / lustre / include / obd.h
index 289b1bc..b208efd 100644 (file)
@@ -130,6 +130,20 @@ struct lov_stripe_md {
 #define lsm_stripe_count lsm_wire.lw_stripe_count
 #define lsm_pool_name    lsm_wire.lw_pool_name
 
+static inline bool lsm_is_released(struct lov_stripe_md *lsm)
+{
+       return !!(lsm->lsm_pattern & LOV_PATTERN_F_RELEASED);
+}
+
+static inline bool lsm_has_objects(struct lov_stripe_md *lsm)
+{
+       if (lsm == NULL)
+               return false;
+       if (lsm_is_released(lsm))
+               return false;
+       return true;
+}
+
 struct obd_info;
 
 typedef int (*obd_enqueue_update_f)(void *cookie, int rc);