]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/lustre/lustre/lov/lov_internal.h
staging/lustre/lov: don't crash accessing LOV object with FID{0, 0}
[karo-tx-linux.git] / drivers / staging / lustre / lustre / lov / lov_internal.h
index 8c8508bbbb808750b36411841683f0583cc0de8e..b644acc9b034c0c36cf726aecfbd65e33f8d995e 100644 (file)
@@ -304,4 +304,16 @@ static inline struct lov_stripe_md *lsm_addref(struct lov_stripe_md *lsm)
        return lsm;
 }
 
+static inline bool lov_oinfo_is_dummy(const struct lov_oinfo *loi)
+{
+       if (unlikely(loi->loi_oi.oi.oi_id == 0 &&
+                    loi->loi_oi.oi.oi_seq == 0 &&
+                    loi->loi_ost_idx == 0 &&
+                    loi->loi_ost_gen == 0))
+               return true;
+
+       return false;
+}
+
+
 #endif