]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_file.cc
update sources to v12.1.2
[ceph.git] / ceph / src / rgw / rgw_file.cc
index 09c98654456405cf9bc006cc089cb2516c882397..83df3ddbf01bb94ede7be806e23b69f3006cf627 100644 (file)
@@ -839,8 +839,7 @@ namespace rgw {
       = get_context()->_conf->rgw_nfs_namespace_expire_secs;
 
     /* max events to gc in one cycle */
-    uint32_t max_ev =
-      std::max(1, get_context()->_conf->rgw_nfs_max_gc);
+    uint32_t max_ev = get_context()->_conf->rgw_nfs_max_gc;
 
     struct timespec now, expire_ts;
     event_vector ve;
@@ -1846,6 +1845,22 @@ int rgw_readdir(struct rgw_fs *rgw_fs,
   return rc;
 }
 
+/* project offset of dirent name */
+int rgw_dirent_offset(struct rgw_fs *rgw_fs,
+                     struct rgw_file_handle *parent_fh,
+                     const char *name, int64_t *offset,
+                     uint32_t flags)
+{
+  RGWFileHandle* parent = get_rgwfh(parent_fh);
+  if ((! parent)) {
+    /* bad parent */
+    return -EINVAL;
+  }
+  std::string sname{name};
+  int rc = parent->offset_of(sname, offset, flags);
+  return rc;
+}
+
 /*
    read data from file
 */