summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-21 04:48:21 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-22 13:06:30 +0530
commit1cb8064b2a653f06062c226dc12d524d8f1a2da2 (patch)
tree32e1a7ac1e81e96e9d27e181b7c263c3c4712125 /xlators
parentd769066ddcb7b3fab456a57704b184d0617b8d52 (diff)
io-threads: Add statfs fop
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index a71273646..672cc285e 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -1562,10 +1562,42 @@ iot_fsyncdir (call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync)
return 0;
}
+int
+iot_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct statvfs *buf)
+{
+ STACK_UNWIND (frame, op_ret, op_errno, buf);
+ return 0;
+}
+
+int
+iot_statfs_wrapper (call_frame_t *frame, xlator_t *this, loc_t *loc)
+{
+ STACK_WIND (frame, iot_statfs_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->statfs, loc);
+ return 0;
+}
+
+int
+iot_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc)
+{
+ call_stub_t *stub = NULL;
+
+ stub = fop_statfs_stub (frame, iot_statfs_wrapper, loc);
+ if (!stub) {
+ gf_log (this->name, GF_LOG_ERROR, "cannot get statfs stub");
+ STACK_UNWIND (frame, -1, ENOMEM, NULL);
+ return 0;
+ }
+
+ iot_schedule_unordered ((iot_conf_t *)this->private, loc->inode, stub);
+ return 0;
+}
+
/* Must be called with worker lock held */
void
_iot_queue (iot_worker_t *worker,
- iot_request_t *req)
+ iot_request_t *req)
{
list_add_tail (&req->list, &worker->rqlist);
@@ -2086,6 +2118,7 @@ struct xlator_fops fops = {
.link = iot_link, /* U */
.opendir = iot_opendir, /* U */
.fsyncdir = iot_fsyncdir, /* O */
+ .statfs = iot_statfs, /* U */
};
struct xlator_mops mops = {