- RETURN(0);
-}
-
-/* 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_LOCKED(&lsm->lsm_lock);
-#ifdef __KERNEL__
- LASSERT(lsm->lsm_lock_owner == cfs_current());
-#endif
-
- if (shrink) {
- struct lov_oinfo *loi;
- for (loi = lsm->lsm_oinfo; stripe < lsm->lsm_stripe_count;
- stripe++, loi++) {
- kms = lov_size_to_stripe(lsm, size, stripe);
- CDEBUG(D_INODE,
- "stripe %d KMS %sing "LPU64"->"LPU64"\n",
- stripe, kms > loi->loi_kms ? "increas" :
- kms < loi->loi_kms ? "shrink" : "leav",
- loi->loi_kms, kms);
- loi->loi_kms = 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->loi_kms = kms;
-
- RETURN(0);
-}
-
-void lov_merge_attrs(struct obdo *tgt, struct obdo *src, obd_flag valid,
- struct lov_stripe_md *lsm, int stripeno, int *set)
-{
- valid &= src->o_valid;
-
- if (*set) {
- if (valid & OBD_MD_FLSIZE) {
- /* this handles sparse files properly */
- obd_size lov_size;
-
- lov_size = lov_stripe_size(lsm, src->o_size, stripeno);
- if (lov_size > tgt->o_size)
- tgt->o_size = lov_size;
- }
- if (valid & OBD_MD_FLBLOCKS)
- tgt->o_blocks += src->o_blocks;
- if (valid & OBD_MD_FLBLKSZ)
- tgt->o_blksize += src->o_blksize;
- if (valid & OBD_MD_FLCTIME && tgt->o_ctime < src->o_ctime)
- tgt->o_ctime = src->o_ctime;
- /* Only mtime from OSTs are merged here, as they cannot be set
- in past (only MDS's mtime can) do not look at ctime. */
- if (valid & OBD_MD_FLMTIME && tgt->o_mtime < src->o_mtime)
- tgt->o_mtime = src->o_mtime;
- } else {
- memcpy(tgt, src, sizeof(*tgt));
- tgt->o_id = lsm->lsm_object_id;
- if (valid & OBD_MD_FLSIZE)
- tgt->o_size = lov_stripe_size(lsm,src->o_size,stripeno);
- *set = 1;
- }