h->fsid = monc->monmap->fsid;
h->tid = cpu_to_le64(req->tid);
msg->hdr.dst = monc->monmap->mon_inst[mon];
- ceph_sysfs_mon_statfs_req_init(monc, req, msg);
+ ceph_sysfs_mon_statfs_req_set(monc, req, msg);
ceph_msg_send(monc->client->msgr, msg, 0);
return 0;
}
schedule_delayed_work(&monc->statfs_delayed_work,
round_jiffies_relative(1*HZ));
monc->num_statfs_requests++;
+ ceph_sysfs_mon_statfs_req_init(monc, &req);
mutex_unlock(&monc->statfs_mutex);
/* send request and wait */
extern void ceph_sysfs_mds_req_cleanup(struct ceph_mds_request *req);
extern int ceph_sysfs_osd_req_init(struct ceph_osd_client *osdc, struct ceph_osd_request *req);
extern void ceph_sysfs_osd_req_cleanup(struct ceph_osd_request *req);
-extern int ceph_sysfs_mon_statfs_req_init(struct ceph_mon_client *monc, struct ceph_mon_statfs_request *req,
+extern int ceph_sysfs_mon_statfs_req_init(struct ceph_mon_client *monc, struct ceph_mon_statfs_request *req);
+extern int ceph_sysfs_mon_statfs_req_set(struct ceph_mon_client *monc, struct ceph_mon_statfs_request *req,
struct ceph_msg *msg);
extern void ceph_sysfs_mon_statfs_req_cleanup(struct ceph_mon_statfs_request *req);
return sprintf(buf, "statfs\n");
}
-int ceph_sysfs_mon_statfs_req_init(struct ceph_mon_client *monc, struct ceph_mon_statfs_request *req,
- struct ceph_msg *msg)
+int ceph_sysfs_mon_statfs_req_init(struct ceph_mon_client *monc, struct ceph_mon_statfs_request *req)
{
int ret = 0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
ret = kobject_init_and_add(&req->kobj, &ceph_mon_statfs_request_ops,
&monc->kobj, "%d", req->tid);
- if (ret)
- goto out;
-
- req->k_mon.dst = msg->hdr.dst;
+#endif
+ memset(&req->k_mon.dst, 0, sizeof(req->k_mon.dst));
ADD_ENTITY_ATTR(req, k_mon, "mon", 0400, req_mon_show, NULL);
ADD_ENTITY_ATTR(req, k_op, "op", 0400, req_mon_op_show, NULL);
- return 0;
-out:
-#endif
return ret;
}
+int ceph_sysfs_mon_statfs_req_set(struct ceph_mon_client *monc, struct ceph_mon_statfs_request *req,
+ struct ceph_msg *msg)
+{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+ req->k_mon.dst = msg->hdr.dst;
+#endif
+ return 0;
+}
+
void ceph_sysfs_mon_statfs_req_cleanup(struct ceph_mon_statfs_request *req)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)