Flex RGWFileHandle::full_object_name() to build either a search
prefix (omits leading "/" and bucket name) or else the full path
to the root (e.g., for pretty-printing), depending on the value
of a boolean omit_bucket argument.
New convenience methods search_prefix() and relative_object_name()
select these, respectively.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Verify that files created in a single, large directory are correctly
enumerated through a sequence of rgw_readdir() calls, at successive
offsets checking cookie/marker and bounds invariants.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
To minimize overhead, traversal events are modeled as a linear
sequence of fh_key, timestamp tuples. GC operates out-of-line in
LIFO order, and includes a ref cycle. If the matching directory
object can't be found by handle, it's already gone, and nothing
happens.
To avoid lock contention, scanning of the event sequence is done
in groups of 24 by default, but in groups of sequence/4 if the
event sequence grows larger than 500 events.
Push READDIR events on successful component readdir (bucket or
object listing partial result, as appropriate).
Revise locking, timestamp and update link count in all cases. Link
counts are approximate (metadata to represent it is not stored).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
They are useful for checking the exact strings being produced,
and in which sequence (object or common prefix).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Augment the existing marker cache with cache of name->type
mappings for up to 128 dirents (appx. 4x the common upper-bound
of 32).
The motivation here is to use the name and type information from
readdir, rather than discarding it. Boosts perf. at least 60%
on unit test corpus.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Ensures that file system instances cannot be disposed while (e.g.)
background processing is ongoing.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Move RGWLibProcess and RGWLibFrontend into new rgw_lib_frontend.h
header, which can include rgw_lib.h and rgw_file.h.
This allows the already-defined RGWLibProcess to call methods on
RGWLibFS objects (e.g., to perform GC, which follows in a separate
commit).
In addition, move all of the library and file interface into
namespace rgw.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
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>