*/
static int mds_connect(const struct lu_env *env,
struct lustre_handle *conn, struct obd_device *obd,
- struct obd_uuid *cluuid, struct obd_connect_data *data)
+ struct obd_uuid *cluuid, struct obd_connect_data *data,
+ void *localdata)
{
struct obd_export *exp;
struct mds_export_data *med;
memcpy(mcd->mcd_uuid, cluuid, sizeof(mcd->mcd_uuid));
med->med_mcd = mcd;
- rc = mds_client_add(obd, exp, -1);
+ rc = mds_client_add(obd, exp, -1, localdata);
GOTO(out, rc);
out:
{
struct mds_export_data *med = &exp->exp_mds_data;
- INIT_LIST_HEAD(&med->med_open_head);
+ CFS_INIT_LIST_HEAD(&med->med_open_head);
spin_lock_init(&med->med_open_lock);
spin_lock(&exp->exp_lock);
}
static int mds_obd_statfs(struct obd_device *obd, struct obd_statfs *osfs,
- __u64 max_age)
+ __u64 max_age, __u32 flags)
{
int rc;
/* We call this so that we can cache a bit - 1 jiffie worth */
rc = mds_obd_statfs(obd, lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF,
size[REPLY_REC_OFF]),
- cfs_time_current_64() - HZ);
+ cfs_time_current_64() - HZ, 0);
if (rc) {
CERROR("mds_obd_statfs failed: rc %d\n", rc);
GOTO(out, rc);
if (rc)
GOTO(out, rc);
- if (body->fid1.id == 0) {
- /* a fid of zero is taken to mean "sync whole filesystem" */
- rc = fsfilt_sync(obd, obd->u.obt.obt_sb);
- GOTO(out, rc);
- } else {
+ rc = fsfilt_sync(obd, obd->u.obt.obt_sb);
+ if (rc == 0 && body->fid1.id != 0) {
struct dentry *de;
de = mds_fid2dentry(mds, &body->fid1, NULL);
if (IS_ERR(de))
GOTO(out, rc = PTR_ERR(de));
- /* The file parameter isn't used for anything */
- if (de->d_inode->i_fop && de->d_inode->i_fop->fsync)
- rc = de->d_inode->i_fop->fsync(NULL, de, 1);
- if (rc == 0) {
- body = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF,
- sizeof(*body));
- mds_pack_inode2fid(&body->fid1, de->d_inode);
- mds_pack_inode2body(body, de->d_inode);
- }
+ body = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF,
+ sizeof(*body));
+ mds_pack_inode2fid(&body->fid1, de->d_inode);
+ mds_pack_inode2body(body, de->d_inode);
l_dput(de);
- GOTO(out, rc);
}
+ GOTO(out, rc);
out:
req->rq_status = rc;
return 0;
lprocfs_alloc_obd_stats(obd, LPROC_MDS_LAST) == 0) {
/* Init private stats here */
mds_stats_counter_init(obd->obd_stats);
- obd->obd_proc_exports = proc_mkdir("exports",
- obd->obd_proc_entry);
+ obd->obd_proc_exports_entry = lprocfs_register("exports",
+ obd->obd_proc_entry,
+ NULL, NULL);
+ if (IS_ERR(obd->obd_proc_exports_entry)) {
+ rc = PTR_ERR(obd->obd_proc_exports_entry);
+ CERROR("error %d setting up lprocfs for %s\n",
+ rc, "exports");
+ obd->obd_proc_exports_entry = NULL;
+ }
}
rc = mds_fs_setup(obd, mnt);
GOTO(err_ns, rc);
}
+ if (obd->obd_proc_exports_entry)
+ lprocfs_add_simple(obd->obd_proc_exports_entry,
+ "clear", lprocfs_nid_stats_clear_read,
+ lprocfs_nid_stats_clear_write, obd);
+
rc = mds_lov_presetup(mds, lcfg);
if (rc < 0)
GOTO(err_fs, rc);
mds->mds_group_hash = NULL;
#endif
err_ns:
- lprocfs_obd_cleanup(obd);
lprocfs_free_obd_stats(obd);
+ lprocfs_obd_cleanup(obd);
ldlm_namespace_free(obd->obd_namespace, 0);
obd->obd_namespace = NULL;
err_ops:
we just need to drop our ref */
class_export_put(mds->mds_osc_exp);
- lprocfs_obd_cleanup(obd);
+ lprocfs_remove_proc_entry("clear", obd->obd_proc_exports_entry);
+ lprocfs_free_per_client_stats(obd);
lprocfs_free_obd_stats(obd);
+ lprocfs_obd_cleanup(obd);
lquota_cleanup(mds_quota_interface_ref, obd);