#include "ofd_internal.h"
#include <obd_cksum.h>
-#include <lquota.h>
+#include <lustre_quota.h>
static int ofd_export_stats_init(struct ofd_device *ofd,
struct obd_export *exp, void *client_nid)
return 0;
}
+int ofd_postrecov(const struct lu_env *env, struct ofd_device *ofd)
+{
+ struct lu_device *ldev = &ofd->ofd_dt_dev.dd_lu_dev;
+
+ CDEBUG(D_HA, "%s: recovery is over\n", ofd_obd(ofd)->obd_name);
+ return ldev->ld_ops->ldo_recovery_complete(env, ldev);
+}
+
int ofd_obd_postrecov(struct obd_device *obd)
{
struct lu_env env;
RETURN(rc);
ofd_info_init(&env, obd->obd_self_export);
- rc = ldev->ld_ops->ldo_recovery_complete(&env, ldev);
+ rc = ofd_postrecov(&env, ofd_dev(ldev));
+
lu_env_fini(&env);
RETURN(rc);
}
ENTRY;
+ fo = ofd_object_find(env, ofd, fid);
+ if (IS_ERR(fo))
+ RETURN(PTR_ERR(fo));
+
/* Tell the clients that the object is gone now and that they should
* throw away any cached pages. */
ofd_build_resid(fid, &info->fti_resid);
if (rc == ELDLM_OK)
ldlm_lock_decref(&lockh, LCK_PW);
- fo = ofd_object_find(env, ofd, fid);
- if (IS_ERR(fo))
- RETURN(PTR_ERR(fo));
LASSERT(fo != NULL);
rc = ofd_object_destroy(env, fo, orphan);
lrc = ofd_destroy_by_fid(env, ofd, &info->fti_fid, 0);
if (lrc == -ENOENT) {
CDEBUG(D_INODE,
- "destroying non-existent object "LPU64"\n",
- oa->o_id);
+ "%s: destroying non-existent object "DFID"\n",
+ ofd_obd(ofd)->obd_name, PFID(&info->fti_fid));
/* rewrite rc with -ENOENT only if it is 0 */
if (rc == 0)
rc = lrc;
} else if (lrc != 0) {
- CEMERG("error destroying object "LPU64": %d\n",
- oa->o_id, rc);
+ CERROR("%s: error destroying object "DFID": %d\n",
+ ofd_obd(ofd)->obd_name, PFID(&info->fti_fid),
+ rc);
rc = lrc;
}
count--;
GOTO(out, rc = PTR_ERR(fo));
}
- ofd_write_lock(env, fo);
if (!ofd_object_exists(fo))
- GOTO(unlock, rc = -ENOENT);
+ GOTO(put, rc = -ENOENT);
if (dt_version_get(env, ofd_object_child(fo)) >
ofd_obd(ofd)->obd_last_committed) {
rc = dt_object_sync(env, ofd_object_child(fo));
if (rc)
- GOTO(unlock, rc);
+ GOTO(put, rc);
}
oinfo->oi_oa->o_valid = OBD_MD_FLID;
ofd_counter_incr(exp, LPROC_OFD_STATS_SYNC, oinfo->oi_jobid, 1);
EXIT;
-unlock:
- ofd_write_unlock(env, fo);
+put:
ofd_object_put(env, fo);
out:
return rc;