summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/defaults.c
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-09-17 05:56:25 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-22 06:13:32 -0700
commitfaf97734112ebe11d8a411351d9f23b528b9d616 (patch)
treed8b898e842c1be3c3b760d41188f7a4b0078232b /libglusterfs/src/defaults.c
parent239d2cbdb0a4c32df9f21de8385e2c466b934178 (diff)
downloadglusterfs-faf97734112ebe11d8a411351d9f23b528b9d616.tar.gz
glusterfs-faf97734112ebe11d8a411351d9f23b528b9d616.tar.xz
glusterfs-faf97734112ebe11d8a411351d9f23b528b9d616.zip
libglusterfs: Add RCHECKSUM fop.
rchecksum (fd, offset, len): Calculates both the weak and strong checksums for a block of {len} bytes at {offset} in {fd}. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'libglusterfs/src/defaults.c')
-rw-r--r--libglusterfs/src/defaults.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/libglusterfs/src/defaults.c b/libglusterfs/src/defaults.c
index ef8104e594..e48fd31516 100644
--- a/libglusterfs/src/defaults.c
+++ b/libglusterfs/src/defaults.c
@@ -1403,6 +1403,39 @@ default_checksum (call_frame_t *frame,
}
+static int32_t
+default_rchecksum_cbk (call_frame_t *frame,
+ void *cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno,
+ uint32_t weak_checksum,
+ uint8_t *strong_checksum)
+{
+ STACK_UNWIND (frame,
+ op_ret,
+ op_errno,
+ weak_checksum,
+ strong_checksum);
+ return 0;
+}
+
+
+int32_t
+default_rchecksum (call_frame_t *frame,
+ xlator_t *this,
+ fd_t *fd, off_t offset,
+ int32_t len)
+{
+ STACK_WIND (frame,
+ default_rchecksum_cbk,
+ FIRST_CHILD(this),
+ FIRST_CHILD(this)->fops->rchecksum,
+ fd, offset, len);
+ return 0;
+}
+
+
int32_t
default_readdir_cbk (call_frame_t *frame,
void *cookie,