[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

chunkd's get-partial API



Just as an FYI...  these are the chunkd client API changes for GET_PART,
the new chunkd command that retrieves a partial subset of an object.

It's pretty straightforward, adding an (offset, max-length) pair to the
existing GET-related APIs.



diff --git a/include/chunkc.h b/include/chunkc.h
index 1fd7066..d35f1c2 100644
--- a/include/chunkc.h
+++ b/include/chunkc.h
@@ -74,6 +74,19 @@ extern bool stc_get_start(struct st_client *stc, const void *key,
 			size_t key_len,int *pfd, uint64_t *len);
 extern size_t stc_get_recv(struct st_client *stc, void *data, size_t len);
 
+extern bool stc_get_part(struct st_client *stc, const void *key, size_t key_len,
+			 uint64_t offset, uint64_t max_len,
+	     size_t (*write_cb)(void *, size_t, size_t, void *),
+	     void *user_data);
+extern void *stc_get_part_inline(struct st_client *stc,
+			    const void *key, size_t key_len,
+			    uint64_t offset, uint64_t max_len,
+			    size_t *len);
+extern bool stc_get_part_start(struct st_client *stc, const void *key,
+			size_t key_len,
+			uint64_t offset, uint64_t max_len,
+			int *pfd, uint64_t *len);
+
 extern bool stc_put(struct st_client *stc, const void *key, size_t key_len,
 	     size_t (*read_cb)(void *, size_t, size_t, void *),
 	     uint64_t len, void *user_data, uint32_t flags);
@@ -113,6 +126,23 @@ static inline bool stc_get_startz(struct st_client *stc, const char *key,
 	return stc_get_start(stc, key, strlen(key) + 1, pfd, len);
 }
 
+static inline void *stc_get_part_inlinez(struct st_client *stc,
+				    const char *key,
+			    	    uint64_t offset, uint64_t max_len,
+				    size_t *len)
+{
+	return stc_get_part_inline(stc, key, strlen(key) + 1, offset, max_len,
+				   len);
+}
+
+static inline bool stc_get_part_startz(struct st_client *stc, const char *key,
+				  uint64_t offset, uint64_t max_len,
+				  int *pfd, uint64_t *len)
+{
+	return stc_get_part_start(stc, key, strlen(key) + 1,
+				  offset, max_len, pfd, len);
+}
+
 static inline bool stc_put_inlinez(struct st_client *stc, const char *key,
 				   void *data, uint64_t len, uint32_t flags)
 {
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux