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>
This a cache-line-friendly set of primitives for
a) shareded, intrusive maps based on boost::intrusive
b) an LRU system based on them
The system uses per-lane (shard) locks. Lane count, front cache
size, and lock type are template params.
Initially, use this in preference to an unshareded map or hashtable,
in new RGW code.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
The changes to GET_OBJECT and PUT_OBJECT test options are needed,
since they are (re) writing the same object.
Sadly, READV_AFTER_WRITEV is failing at page offset 7.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
* rgw_file.cc needed to include include/assert.h AFTER all rgw
includes, for some reason
* use *_dout syntax as target of bl.hexdump in lbrgw_file_gp.cc
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
The model in the rgw_readv call is the caller owns the struct rgw_uio,
and uses it to pass uio_offset.
The caller returns the rgw_uio filled out, and provides indirectly
rgw_uio->uio_vio (the full private data is at uio->uio_p1 on return,
the caller (p==private) must not touch it. The caller returns
private data in rgw_readv_release() when finished.
Meanwhile rgw_writev is atomic.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Update rgw_write to return bytes written as an OUT argument,
use and verify in PUT test.
A new WRITE_READ_VERIFY test writes 16 checksummed, 64K data pages
to the object when --bulk specified. The returned write value is
checked, but pages not re-read (yet).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>