Re-implement rgw_getattr to just dispatch into RGWFileHandle::stat,
we expect all objects to stat correctly for their type.
The size of file objects is currently reporting as 0, where we expect
a small, positive size (reviewing).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
rgw_create hadn't been re-implemented for NFS namespace behavior,
where we expect it to create empty file objects.
It needs to do a full name conflict check with prefix-matching,
to catch conflicts within object names.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Fixes handle type after rgw_mkdir.
Add handle type checks to nfsns unit tests. Adds tests to create
files and directories with non-bucket parent.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Adds method to RGWStatBucketRequest to access the creation_time of
the returned bucket.
(For now, that's the only timestamp we have.)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Fix the error returns from rgw_unlink. This is sufficient to
catch the errors that arise from operation failure.
We won't notice attempts to remove interior directories--and for
various reasons, that may be problematic (skip for now).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Split the transiently-creating concept (CREATING) from the request
to create objects used in lookup_fh.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Ganesha traditionally does not expect them, but they may be needed
when bypassing the MDCACHE (2.4).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
New logic propagates is_truncated traveral-finished indicator up
from bucket and object list operations in all cases, and correctly
expands relative paths.
Unit test output looks promising.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Successfully creates 5*1024 objects at /nfsroot/nfs_marker/, verifies
externally.
Follow-up rgw_readdir shows 999 results, apparently the initial readdir
segment works correctly, but restart from offset fails.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
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>