]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librgw: update rgw_readdir interface (stub impl)
authorMatt Benjamin <mbenjamin@redhat.com>
Thu, 3 Sep 2015 19:11:10 +0000 (15:11 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 12 Feb 2016 16:57:44 +0000 (11:57 -0500)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/include/rados/rgw_file.h
src/rgw/rgw_file.cc

index e07f66bcbe5131e331cac90cb33f704e5d081fb2..c39d0f8859abb51520b93770a8d6afaf52957796 100644 (file)
@@ -101,7 +101,10 @@ int rgw_lookup(const struct rgw_file_handle *parent_handle, const char *path,
 /*
   read  directory content
 */
-int rgw_readdir(const struct rgw_file_handle *parent_handle, const char *path);
+typedef bool (*rgw_readdir_cb)(const char *name, void *arg, uint64_t cookie);
+
+int rgw_readdir(const struct rgw_file_handle *parent_handle, uint64_t offset,
+               rgw_readdir_cb cb, void *cb_arg, int *eof);
 
 int rgw_set_attributes(const struct rgw_file_handle *handle);
 
index a08700e1676b49b7b21828361e6d2fcf907a9096..9579f75c081a0f026617a64c316d5014034ee04b 100644 (file)
@@ -172,7 +172,8 @@ int rgw_getattr(const struct rgw_file_handle *handle, struct stat *st)
 /*
   read directory content
 */
-int rgw_readdir(const struct rgw_file_handle* parent_handle, const char* path)
+int rgw_readdir(const struct rgw_file_handle *parent_handle, uint64_t offset,
+               rgw_readdir_cb rcb, void *cb_arg, int *eof)
 {
   string uri;
   int rc;
@@ -182,7 +183,7 @@ int rgw_readdir(const struct rgw_file_handle* parent_handle, const char* path)
     return rc;
   }
 
-#if 0
+#if 0 /* TODO: implement */
   if (is_root(uri)) {
     /* get the bucket list */
     return librgw.get_user_buckets_list();
@@ -194,5 +195,12 @@ int rgw_readdir(const struct rgw_file_handle* parent_handle, const char* path)
   }
 #endif
 
+  /* XXXX */
+  (void) rcb("test1", cb_arg, 1);
+  (void) rcb("test2", cb_arg, 2);
+  (void) rcb("test3", cb_arg, 3);
+
+  *eof = true;
+
   return 0;
 }