Whamcloud - gitweb
LU-13783 procfs: fix improper prop_ops fields
[fs/lustre-release.git] / lustre / lmv / lmv_internal.h
index 340bd5a..a1d4436 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef _LMV_INTERNAL_H_
@@ -66,21 +65,21 @@ int lmv_statfs_check_update(struct obd_device *obd, struct lmv_tgt_desc *tgt);
 
 static inline struct obd_device *lmv2obd_dev(struct lmv_obd *lmv)
 {
-       return container_of0(lmv, struct obd_device, u.lmv);
+       return container_of_safe(lmv, struct obd_device, u.lmv);
 }
 
 static inline struct lu_tgt_desc *
 lmv_tgt(struct lmv_obd *lmv, __u32 index)
 {
-       return index < lmv->lmv_mdt_descs.ltd_tgt_bitmap->size ?
+       return index < lmv->lmv_mdt_descs.ltd_tgts_size ?
                LTD_TGT(&lmv->lmv_mdt_descs, index) : NULL;
 }
 
 static inline bool
 lmv_mdt0_inited(struct lmv_obd *lmv)
 {
-       return lmv->lmv_mdt_descs.ltd_tgt_bitmap->size > 0 &&
-              cfs_bitmap_check(lmv->lmv_mdt_descs.ltd_tgt_bitmap, 0);
+       return lmv->lmv_mdt_descs.ltd_tgts_size > 0 &&
+              test_bit(0, lmv->lmv_mdt_descs.ltd_tgt_bitmap);
 }
 
 #define lmv_foreach_tgt(lmv, tgt) ltd_foreach_tgt(&(lmv)->lmv_mdt_descs, tgt)