+void filter_grant_commit(struct obd_export *exp, int niocount,
+ struct niobuf_local *res)
+{
+ struct filter_obd *filter = &exp->exp_obd->u.filter;
+ struct niobuf_local *lnb = res;
+ unsigned long pending = 0;
+ int i;
+
+ spin_lock(&exp->exp_obd->obd_osfs_lock);
+ for (i = 0, lnb = res; i < niocount; i++, lnb++)
+ pending += lnb->lnb_grant_used;
+
+ LASSERTF(exp->exp_filter_data.fed_pending >= pending,
+ "%s: cli %s/%p fed_pending: %lu grant_used: %lu\n",
+ exp->exp_obd->obd_name, exp->exp_client_uuid.uuid, exp,
+ exp->exp_filter_data.fed_pending, pending);
+ exp->exp_filter_data.fed_pending -= pending;
+ LASSERTF(filter->fo_tot_granted >= pending,
+ "%s: cli %s/%p tot_granted: "LPU64" grant_used: %lu\n",
+ exp->exp_obd->obd_name, exp->exp_client_uuid.uuid, exp,
+ exp->exp_obd->u.filter.fo_tot_granted, pending);
+ filter->fo_tot_granted -= pending;
+ LASSERTF(filter->fo_tot_pending >= pending,
+ "%s: cli %s/%p tot_pending: "LPU64" grant_used: %lu\n",
+ exp->exp_obd->obd_name, exp->exp_client_uuid.uuid, exp,
+ filter->fo_tot_pending, pending);
+ filter->fo_tot_pending -= pending;
+
+ spin_unlock(&exp->exp_obd->obd_osfs_lock);
+}
+int filter_do_cow(struct obd_export *exp, struct obd_ioobj *obj,
+ int nioo, struct niobuf_remote *rnb)
+{
+ struct dentry *dentry;
+ struct lvfs_run_ctxt saved;
+ struct write_extents *extents = NULL;
+ int j, rc = 0, numexts = 0, flags = 0;