* 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>
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>
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>
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>
* set uri in rgw_mkdir (duh)
* RGWCreateBucketRequest should override RGWHandler::read_permissions
to return 0
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
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>
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>
* 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>
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>
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>
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>
* 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>
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>