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>
There is some asymmetry here, since directories are also inferred
from object names containing embedded "/."
The obvious question seems to be, "when can a leaf directory be
garbage collected?" The answer seems to be, "only explicitly."
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Fix handling of bucket namespace, remove bogus RGWLibFS::is_root()
logic. Also remove a stray debug check.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Ganesa ULP needs to see a sane progression of attrs in the CREATE
path.
With this change shell actions like
$ echo "hi" > /nfs41/mybucket/mom
work as expected.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Possibly RGW vnodes should cache Unix attrs, it would reduce the
latency of (frequent) getattr calls, and eventually lines up with
more materialized Unix attributes.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Incremental work to support CREATE,OPEN,WRITE*,CLOSE transactions.
Adds a new tuple-based signature for RGWFileHandle::lookup_fh, and
fixes an inconsisten initialization of fhk and fh.fh_hk.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
The current API relies on rgw_lookup and rgw_lookup_filehandle to
return file handle instances, and like POSIX, needs to deal in some
way with the NFS/POSIX open-for-create concept.
For now, allow rgw_lookup to return the canonical instance for an
object being created, i.e., if the option RGW_LOOKUP_FLAG_CREATE
is passed. (I added an RGW_OPEN_FLAG_CREATE also, but it doesn't
do anything.)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
The fids1, fids2 vectors were confusing, as fids2 mapped the
objects in the union of all buckets.
Now there's a matrix of <bucket,object>, and it's trivial to
scan the objects in any one bucket.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
* implement a stat operation over RGWGetObj (returning early)
* use stat to validate rgw_lookup
* use stat to implement rgw_getattr
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>