The behavior of these requests is basically specific to the
needs of NFS READDIR and READ. (RGWWriteRequest already updated.)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Add sstring.h from Seastar, slightly adapted for c++2011 and
boost::string_ref.
An sstring resembles std::string, but the size of its small-string
optimization (static allocation) is controlled by a template
argument (cf. small_vector).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
This re-uses intrusive lane LRU and co-resident intrusive b-tree
for lookups (formerly, we were using just the dictionary).
Machinery for cache drain on unmount/release of an active filesystem
instance has been added. Currently, this code won't be reached.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Update RGWGetObj to take ulp buffer rather than transferring the
elements of a buffer::list and re-traversing it.
This breaks the readv variant, but that was not final. What it
fixes is offset handling.
Also, skip CREATE_BUCKET if not requested, in librgw_file_aw.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
This commit finishes hooking up RGWWriteRequest, and its supporting
RGWLibContinuedRequest.
The rgw_read call now fails--trivially, because it never handled
starting offset correctly.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
The last issue with enumeration was caused by inserting objects
into handle cache with their key-ified full_object_name()--this
should be the base name.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
* remove path in RGWStatLeafRequest--use bool is_dir instead
* remove unused uri in RGWListBucketRequest
* more dbg prints; problem w/final segment in obj_rec
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
As of this change, enumeration is -almost- correct, but the
rules for name, object_name(), and full_object_name() need to be
checked.
The rationale for storing just the last component name in dirents
means that name can't ever have the form "foo/bar" (make sure it
doesn't). But there may still be code which assumes name ==
object_name() OR assumes object_name() is hashable (it isn't, that
has to be the full object name).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
1. stat_leaf() and stat_bucket() require RGWFileHandle::FLAG_CREATE
2. refactor RGWStatLeafRequest on the model of RGWListBucketRequest
3. fix uses of is_object() which meant is_file()
4. fix parent_fh passing
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Add the count of common_prefixes to the existing listing size, rather
than overwriting it, else size cannot be compared w/ix.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
In both paths, instantiate a file handle iff the remote op
succeeded.
If this operation lost a race to create an object with the same
name, we cannot correctly return a valid result and handle in all
cases, so don't attempt it.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
1. instantiate handles as required in RGWLibFS::stat_bucket
2. fix bucket_name() when bucket
3. fix full_object_name(), which should not return paths w/buckets
by default (allow doing so by passing non-default depth)
4. fix uri, prefix, and delimiter logic
5. add logic to parse and forward common_prefixes
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
An rgw_lookup w/RGW_LOOKUP_FLAG_NONE will return an existing (hence
validated, modulo CREATE races) handle, but fail with ENOENT if none
exists (which is the desired behavior).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Implement the required check for underlying leaf object, since with
the current signature it is not known.
(Is that a fixed requirement? If we have previously done a lookup, we
already know the underlying object by name and type.)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Really would like to remove the requirement to format a URI for these
requests, since it is merely taken apart in parsing before execution.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Now the code attempts to read an object header (which may be cached),
and if this fails, uses RGWStatLeafRequest to find a potential matching
file or directory leaf.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
RGWFileHandle gets a type-specific variant part. For the directory
variant, define a flat_map of cookie to marker. Hash dirent names and
update the marker_cache in readdirs.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
RGW objects which happen to represent directories will always end
in '/', but the trailing slash will not be present in cached versions
of the name.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Stats one of <object>, <object/>. Additional control over handle
creation has been added to RGWLibFS::lookup_fh.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>