]>
git.apps.os.sepia.ceph.com Git - ceph.git/log
Matt Benjamin [Wed, 9 Dec 2015 19:58:35 +0000 (14:58 -0500)]
librgw: implement stat_bucket, call from rgw_lookup
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 9 Dec 2015 17:47:34 +0000 (12:47 -0500)]
librgw: annotate unlink's rgw_lookup
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>
Matt Benjamin [Wed, 9 Dec 2015 16:18:19 +0000 (11:18 -0500)]
librgw: add lookup step in rgw_unlink
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>
Matt Benjamin [Wed, 9 Dec 2015 16:04:39 +0000 (11:04 -0500)]
librgw: hide uri in RGWListBucketRequest, use full_objectname()
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>
Matt Benjamin [Tue, 8 Dec 2015 23:52:46 +0000 (18:52 -0500)]
librgw: add marker processing to RGWListBucket(s)Request
Ignores object instances, for now. Not verified.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 8 Dec 2015 21:18:50 +0000 (16:18 -0500)]
librgw: reimplement RGWLibFS::stat_leaf
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>
Matt Benjamin [Mon, 7 Dec 2015 14:38:58 +0000 (09:38 -0500)]
librgw: variant handle subtype and marker cache
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>
Matt Benjamin [Sun, 6 Dec 2015 21:39:35 +0000 (16:39 -0500)]
librgw: create dir file handles w/correct type
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>
Matt Benjamin [Sun, 6 Dec 2015 19:25:24 +0000 (14:25 -0500)]
librgw: implement RGWLibFS::stat_leaf
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>
Matt Benjamin [Wed, 2 Dec 2015 15:44:19 +0000 (10:44 -0500)]
librgw: incr rework stat
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 2 Dec 2015 02:04:40 +0000 (21:04 -0500)]
librgw: fix uninitialized rgw_fh
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 1 Dec 2015 20:22:12 +0000 (15:22 -0500)]
cohort_lru: fix a maybe uninitialized warning (that seems invalid)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 1 Dec 2015 18:05:50 +0000 (13:05 -0500)]
librgw: create explicit directory leaf objects in rgw_mkdir
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>
Matt Benjamin [Tue, 1 Dec 2015 17:50:51 +0000 (12:50 -0500)]
librgw: consolidate RGWLib RGWOps into RGWRequest
The intermediate derivation mirrored that in RGWRest, but we
don't seem to need it.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 1 Dec 2015 17:34:33 +0000 (12:34 -0500)]
librgw: don't discard lookup result, fix signedness of min_size
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 30 Nov 2015 22:15:19 +0000 (17:15 -0500)]
librgw: make_fhk put base name, object_name in wrong order
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 30 Nov 2015 22:00:21 +0000 (17:00 -0500)]
librgw: add pseudo() accessor
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 30 Nov 2015 21:55:27 +0000 (16:55 -0500)]
librgw: add pseudofs awareness to lookup_fh
And then allow rgw_mkdir() to create pseudofs vnodes, when parent
is not the root.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 30 Nov 2015 18:48:25 +0000 (13:48 -0500)]
librgw: make_fhk, compute object hashes path-wise
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 30 Nov 2015 17:29:39 +0000 (12:29 -0500)]
librgw: add depth and make_path to RGWFileHandle
This just (mostly) efficiently builds a full path from its segments
on demand.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 25 Nov 2015 03:14:37 +0000 (22:14 -0500)]
librgw: compress RGWFileHandle stat data
Just save the state we actually mutate, and fill stat structures
on demand.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 12 Nov 2015 19:55:36 +0000 (14:55 -0500)]
librgw: fix abuse of std::string& in RGWDeleteObjRequest
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 12 Nov 2015 18:53:38 +0000 (13:53 -0500)]
librgw: fix rgw_unlink
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>
Matt Benjamin [Thu, 12 Nov 2015 16:55:37 +0000 (11:55 -0500)]
librgw: ok, make RGW vnodes cache Unix attrs
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>
Matt Benjamin [Thu, 12 Nov 2015 15:32:12 +0000 (10:32 -0500)]
librgw: forge Unix attrs in rgw_create
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>
Matt Benjamin [Wed, 11 Nov 2015 22:30:00 +0000 (17:30 -0500)]
librgw: fix Unix file modes
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 10 Nov 2015 20:51:04 +0000 (15:51 -0500)]
librgw: implement rgw_create + bugfixes
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>
Matt Benjamin [Tue, 10 Nov 2015 16:40:43 +0000 (11:40 -0500)]
librgw: fix size computation in RGWStatObjRequest
Overrides RGWGetObj::execute(), calls the parent method and then
saves obj_size from the manifest.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 10 Nov 2015 14:23:06 +0000 (09:23 -0500)]
librgw: fix many rgw_file return codes
This should all be -(POSIX), or at any rate negative.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 10 Nov 2015 00:19:52 +0000 (19:19 -0500)]
librgw: don't abuse fs_private
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Sun, 8 Nov 2015 23:54:58 +0000 (18:54 -0500)]
librgw: introduce RGW_LOOKUP_FLAG_CREATE
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>
Matt Benjamin [Sun, 8 Nov 2015 23:11:37 +0000 (18:11 -0500)]
librgw: add getattr unit tests, restructure
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>
Matt Benjamin [Sun, 8 Nov 2015 01:40:51 +0000 (20:40 -0500)]
librgw: handle a 3 cases in rgw_getattr
Only the object case is mostly correct.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Sun, 8 Nov 2015 01:06:08 +0000 (20:06 -0500)]
librgw: handle rgw_lookup in the root (minimally)
In addition, check real return code from RGWStatRequest.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Sat, 7 Nov 2015 21:18:18 +0000 (16:18 -0500)]
librgw: change validity check for rgw_lookup
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Sat, 7 Nov 2015 20:46:52 +0000 (15:46 -0500)]
librgw: add RGWStatObjRequest and use it
* 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>
Matt Benjamin [Fri, 6 Nov 2015 21:55:57 +0000 (16:55 -0500)]
librgw: add diagnostic dump_buckets() call.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Fri, 6 Nov 2015 21:55:15 +0000 (16:55 -0500)]
librgw: fail RGWLibFS::authorize() on user-by-id lookup failure
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 5 Nov 2015 16:09:24 +0000 (11:09 -0500)]
librgw: implement rgw_vfsstat
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 5 Nov 2015 15:15:41 +0000 (10:15 -0500)]
librgw: rgw_mkdir and rgw_create return addresses
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 4 Nov 2015 23:26:11 +0000 (18:26 -0500)]
librgw: pass struct rgw_fh_hk by reference
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 4 Nov 2015 22:51:24 +0000 (17:51 -0500)]
librgw: always add struct before rgw_file_handle in rgw_file.h
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 4 Nov 2015 21:20:45 +0000 (16:20 -0500)]
librgw: bring back lookup_handle()
Now as a member of RGWLibFS, and exposed via rgw_lookup_handle()
for use by library clients.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 4 Nov 2015 17:48:03 +0000 (12:48 -0500)]
librgw_file_gp: check test state before closing null fh handle
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 3 Nov 2015 01:31:53 +0000 (20:31 -0500)]
librgw: implement intrusive filehandle cache
The cache is keyed on a hash of bucket name, plus a hash of the
object name.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 2 Nov 2015 19:41:26 +0000 (14:41 -0500)]
librgw: add common/cohort_lru.h
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>
Matt Benjamin [Sat, 31 Oct 2015 00:26:58 +0000 (20:26 -0400)]
librgw_file: release file handles
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Fri, 30 Oct 2015 21:41:39 +0000 (17:41 -0400)]
librgw_file_gp: don't leak a buffer::list
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Fri, 30 Oct 2015 21:27:22 +0000 (17:27 -0400)]
librgw: checksum verify writev/readv read-after-write
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>
Matt Benjamin [Fri, 30 Oct 2015 20:19:35 +0000 (16:19 -0400)]
librgw: really make hexdump optional, set resid in readv unit test
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Fri, 30 Oct 2015 17:28:25 +0000 (13:28 -0400)]
librgw: fix 2 dout problems
* 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>
Matt Benjamin [Thu, 29 Oct 2015 22:03:16 +0000 (18:03 -0400)]
librgw: try-implement rgw_readv/rgw_writev
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>
Matt Benjamin [Thu, 29 Oct 2015 18:58:47 +0000 (14:58 -0400)]
librgw: improve rgw_write and add WRITE_READ_VERIFY
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>
Matt Benjamin [Thu, 29 Oct 2015 16:42:31 +0000 (12:42 -0400)]
librgw: remove junk prints
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 29 Oct 2015 16:36:19 +0000 (12:36 -0400)]
librgw: set RGWGetObj::get_data = true, for great justice
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 29 Oct 2015 15:49:06 +0000 (11:49 -0400)]
librgw: rework library CephContext* and init
Remove duplicated init step. Just reference the global
Ceph context for the library instance(s).
The immediate effect of this is to bring the (correctly initialized)
global context into all call paths, which (e.g.) fixes debug
log prints within subsystems.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 28 Oct 2015 23:10:10 +0000 (19:10 -0400)]
librgw: dispatch RGWDeleteRequest in object branch in rgw_unlink().
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 28 Oct 2015 21:53:06 +0000 (17:53 -0400)]
librgw: implement RGWGetObjRequest
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 27 Oct 2015 21:57:13 +0000 (17:57 -0400)]
librgw: declare RGWDeleteObjRequest
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 27 Oct 2015 21:45:14 +0000 (17:45 -0400)]
librgw: declare RGWGetObjRequest
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 27 Oct 2015 17:02:59 +0000 (13:02 -0400)]
librgw: fix RGWPutObj s->content_length
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 27 Oct 2015 16:23:37 +0000 (12:23 -0400)]
RGWPutObjRequest: fix get_data()
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 27 Oct 2015 14:31:53 +0000 (10:31 -0400)]
rgw log: disambiguate 'Read AccessControlPolicy' (logs)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 27 Oct 2015 14:08:09 +0000 (10:08 -0400)]
librgw: add --prelist to gp to prime cache
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 27 Oct 2015 12:41:52 +0000 (08:41 -0400)]
librgw: fix rgw_open param names and invocation
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 27 Oct 2015 00:24:26 +0000 (20:24 -0400)]
librgw: avoid illegal rele()
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 26 Oct 2015 23:57:58 +0000 (19:57 -0400)]
librgw: don't create/delete in librgw_file.cc (unit test)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 26 Oct 2015 23:44:58 +0000 (19:44 -0400)]
librgw: fs->root_fh is a pointer (and assign it)
Assign and expose the expanded root_fh indirectly from the mounted
root filesystem structure.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 26 Oct 2015 22:13:46 +0000 (18:13 -0400)]
librgw: bucket names can be const
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 26 Oct 2015 21:18:06 +0000 (17:18 -0400)]
librgw: reify root handles
Reify root handle, remove traces of legacy (counter) handles.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 26 Oct 2015 20:36:56 +0000 (16:36 -0400)]
librgw: incremental RGWPutObj work and almost-complete RGWFH refactor.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 26 Oct 2015 19:56:06 +0000 (15:56 -0400)]
xxHash: build internally
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 26 Oct 2015 02:33:54 +0000 (22:33 -0400)]
librgw: add ZPage/ZPageSet abstraction (gp unit tests)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 26 Oct 2015 02:07:03 +0000 (22:07 -0400)]
xxHash: add as submodule
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Sun, 25 Oct 2015 21:22:43 +0000 (17:22 -0400)]
librgw: rgw_file_handle refactor, plus get/put
Implement encapsulation of RGWFileHandle in rgw_file_handle,
so return these from rgw_lookup(), add new rgw_fh_rele() to release
internal state.
Currently the rgw_fh_rele just deletes, in future might be extended
with refcnt support.
Implement the first (atomic) stage of i/o using GET and PUT, add a
new librgw_file_gp test driver for this.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Fri, 23 Oct 2015 22:23:13 +0000 (18:23 -0400)]
librgw: add options for bucket name, multi create, delete
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Fri, 23 Oct 2015 21:56:33 +0000 (17:56 -0400)]
librgw: fix acl assignment in RGWCreateBucket_OS_Lib
The logic to create a default S3 policy in
RGWCreateBucket_OS_Lib::get_params() was essentially correct, but
failed to store the resulting policy on the current request.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Fri, 23 Oct 2015 17:42:28 +0000 (13:42 -0400)]
librgw: don't fake hostname (real hostname isn't used yet)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Fri, 23 Oct 2015 17:18:12 +0000 (13:18 -0400)]
librgw: don't allow running rgwfile tests as anon
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Fri, 23 Oct 2015 16:39:05 +0000 (12:39 -0400)]
librgw: partial delete/unlink support
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 8 Oct 2015 17:12:48 +0000 (13:12 -0400)]
librgw: return result code from execute_request
Update rgw_mkdir and rgw_readdir to use it.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 8 Oct 2015 15:11:40 +0000 (11:11 -0400)]
librgw: fix uri, read_permissions virtual for create-bucket
* set uri in rgw_mkdir (duh)
* RGWCreateBucketRequest should override RGWHandler::read_permissions
to return 0
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 7 Oct 2015 21:19:29 +0000 (17:19 -0400)]
librgw: block in create bucket, rgw_mkdir
Unit test runs, doesn't...seem to create a bucket.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 7 Oct 2015 18:23:13 +0000 (14:23 -0400)]
librgw: re-derive rgw_os_lib family
* shorten names to match files
* remove derivation through rgw_rest intermediates
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 7 Oct 2015 17:50:26 +0000 (13:50 -0400)]
librgw: s/rgw_rest_lib.{h,cc}/rgw_os_lib.{h,cc}
There is no longer an explicit (e.g., inherited) dependency on REST
implementations.
The remaining coupling (via RGWLibEnv, and struct req_state), can
be factored out later.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 7 Oct 2015 17:26:19 +0000 (13:26 -0400)]
lirgw: call RGWHanlder_Lib::init_from_header
Call this from the general RGWLibRequest init() method, after
descendant header_init() has run.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 6 Oct 2015 23:29:25 +0000 (19:29 -0400)]
librgw: cleanups, incremental ListBuckets fixes
1. remove unused RGWLibRequestEnv code marked to delete
2. restore call to RGWHandler::authorize
3. provide RGWLibRequest::authorize implementing it
** the implementation is incomplete, and shows need to expand
the initial mount auth to deal with keystone, etc
4. since acl check is still not quite right in verify_permissions()
disable this again (temporarily)
5. fix dout_subsys of rgw_request.cc
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 6 Oct 2015 20:59:58 +0000 (16:59 -0400)]
librgw: forward cmdline args to librgw_create
Verified w/-d.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 6 Oct 2015 20:41:47 +0000 (16:41 -0400)]
librgw: remove disabled RGWLib RGWREST::get_handler()
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 6 Oct 2015 20:36:06 +0000 (16:36 -0400)]
librgw: cleanups in process_request
* remove disabled S3 authorize step (user authorized on mount)
* re-enable op->verify_permission()
Skipping the latter makes RGW unhappy (1s stalls on each request),
but no objects are listing yet.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 6 Oct 2015 20:14:08 +0000 (16:14 -0400)]
librgw: pull RGWUserinfo user into RGWLibRequest
Also, return result from process_request(req, io) to caller.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 6 Oct 2015 19:36:32 +0000 (15:36 -0400)]
librgw: cache RGWUserInfo in rgw_fs private handle
The private RGWLibFS type holds a RGWUserInfo, and
calls rgw_get_user_info_by_access_key and verifies the returned
secret, checks for suspended user, on rgw_mount.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 5 Oct 2015 19:42:35 +0000 (15:42 -0400)]
librgw: split RGWUserInfo from struct req_state
The immediate purpose is to permit auth caching in RGWLib, but
it seems likely that this will be useful for general req_state
de-bloatification.
For now, all request processing paths put a RGWUserInfo on the
stack, so the lifetime of the object is unchanged from when it was
an expanded member. A later change will introduce caching of
the objects.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 5 Oct 2015 18:58:09 +0000 (14:58 -0400)]
librgw: RGWFileHandle and RGWLibFS
Experimentally reframe the C interface objects as subobjects in
private internal types.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Mon, 5 Oct 2015 15:13:19 +0000 (11:13 -0400)]
librgw: fixes for RGWListBucketRequest callback
The cached req_state is still not correct at RGWOp::execute().
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Sun, 4 Oct 2015 23:40:47 +0000 (19:40 -0400)]
librgw: untested RGWLibListBucketsRequest and caller.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Sun, 4 Oct 2015 18:51:52 +0000 (14:51 -0400)]
librgw: fix 2 bugs in RGWListBuckets, remove scaffolding
1. the prior commit had authorize cognate with S3
1.1 which may be right
1.2 but maybe not for each request
1.3 and lacked priming/forged auth data
The forging of auth data is now easy, but the interesting part is
caching and efficiently attaching it so I paused, and
2. disabled auth, which was now overriding and anonymizing all
requests (good!)
3. fixed another instance of reinterpret_cast where (one of)
dynamic_cast or a saved pointer descendant request (avoids a runtime
check, so will add later) is needed
4. fixed bad offset argument to rgw_readdir
The list bucket facility now works, modulo non-auth.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Sat, 3 Oct 2015 20:28:16 +0000 (16:28 -0400)]
librgw: process_request prologue fixups
* initialize RGWEnv with required HTTP_HOST (incorrectly!)
* assign req_state::cio (not really correctly)
* remove incorrect delete of RGWOp, which no longer alloc'd
Now runs, but don't see buckets.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Sat, 3 Oct 2015 17:58:24 +0000 (13:58 -0400)]
librgw: reprocess process_request
Refactor RGWLib variant of process_request(...) as a (actually 2,
one which puts an RGWLibIO on the stack) member function of
RGWLibProcess.
Also replace extern abort_early with static inline abort_req(),
since the rgw_rest extern assumes HTTP/REST.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Fri, 2 Oct 2015 21:51:22 +0000 (17:51 -0400)]
librgw: wire up RGWLibFrontend enqueue and exec operations
Adds the missing bits of RGWLibProcess and RGWLibFrontend, and
calls them from rgw_readdir().
Clients can call enqueue_req() to route a request through the
work queue, or execute_req() to run it inline.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>