Whamcloud - gitweb
LU-3963 libcfs: remove last cfs wrappers for cpu node handling
[fs/lustre-release.git] / lustre / lov / lov_merge.c
index 5407c11..7362ead 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LOV
 
-#ifdef __KERNEL__
 #include <libcfs/libcfs.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd_class.h>
-#include <obd_lov.h>
-
 #include "lov_internal.h"
 
 /** Merge the lock value block(&lvb) attributes and KMS from each of the
@@ -64,10 +58,8 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
        int i;
        int rc = 0;
 
-       LASSERT(spin_is_locked(&lsm->lsm_lock));
-#ifdef __KERNEL__
+       assert_spin_locked(&lsm->lsm_lock);
        LASSERT(lsm->lsm_lock_owner == current_pid());
-#endif
 
        CDEBUG(D_INODE, "MDT ID "DOSTID" initial value: s="LPU64" m="LPU64
               " a="LPU64" c="LPU64" b="LPU64"\n", POSTID(&lsm->lsm_oi),
@@ -118,46 +110,6 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
         RETURN(rc);
 }
 
-/* Must be called under the lov_stripe_lock() */
-int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
-                   obd_off size, int shrink)
-{
-        struct lov_oinfo *loi;
-        int stripe = 0;
-        __u64 kms;
-        ENTRY;
-
-       LASSERT(spin_is_locked(&lsm->lsm_lock));
-#ifdef __KERNEL__
-       LASSERT(lsm->lsm_lock_owner == current_pid());
-#endif
-
-        if (shrink) {
-                for (; stripe < lsm->lsm_stripe_count; stripe++) {
-                        struct lov_oinfo *loi = lsm->lsm_oinfo[stripe];
-                        kms = lov_size_to_stripe(lsm, size, stripe);
-                        CDEBUG(D_INODE,
-                               "stripe %d KMS %sing "LPU64"->"LPU64"\n",
-                               stripe, kms > loi->loi_kms ? "increas":"shrink",
-                               loi->loi_kms, kms);
-                        loi_kms_set(loi, loi->loi_lvb.lvb_size = kms);
-                }
-                RETURN(0);
-        }
-
-        if (size > 0)
-                stripe = lov_stripe_number(lsm, size - 1);
-        kms = lov_size_to_stripe(lsm, size, stripe);
-        loi = lsm->lsm_oinfo[stripe];
-
-        CDEBUG(D_INODE, "stripe %d KMS %sincreasing "LPU64"->"LPU64"\n",
-               stripe, kms > loi->loi_kms ? "" : "not ", loi->loi_kms, kms);
-        if (kms > loi->loi_kms)
-                loi_kms_set(loi, kms);
-
-        RETURN(0);
-}
-
 void lov_merge_attrs(struct obdo *tgt, struct obdo *src, obd_valid valid,
                      struct lov_stripe_md *lsm, int stripeno, int *set)
 {