rgw: quota utility class

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: more quota utility stuff

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Formatter: add dump_bool()

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: add bucket quota config to entities

Add bucket quota fields to various entities: regionmap (for global
configuration), user info, bucket info.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: more quota implementation

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: higher level quota check functionality

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: fix qutoa check

size is in kb

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: check quota before completing write op

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: also check quota before starting write

In that case we only do it if it's not chunked upload (for which we
don't have the content length).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: update quota stats when needed

Now update the quota stats when completing specific operations.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: init quota

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: bucket stats also dump quota info

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: dump quota params even if disabled

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
radosgw-admin: quota control api

Can set, disable and enable bucket quota.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: handle negative quota as non-assigned values

This means that we can have a 0 as a quota value.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: init RGWBucketStats

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
lru_map: add find_and_update()

A new find_and_update() call to make atomic changes.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: update cache atomically

Use new lru_map::find_and_update() to update internal cache state.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
ceph.spec.in: Always depend on junit4 (fixes bug #6216)

The RPM spec file currently lists `junit` as a dependency on all
platforms except recent versions of OpenSUSE. This is problematic
because `junit` refers to version 3.x, which doesn't satisfy the check
in the configure script:

    configure: Cannot find junit4.jar (apt-get install junit4)

As a result, rpmbuild doesn't build `libcephfs-test.jar` and fails:

    http://tracker.ceph.com/issues/6216

So let's depend on `junit4` in all cases. This package is provided by
all supported platforms (el6, fc17, fc18, fc19, opensuse12.2,
opensuse12, sles11), and my testing on CentOS 6 shows that rpmbuild
now succeeds and produces the expected `libcephfs_jni1` RPM.
Go back to $PWD in fsstress.sh if compiling from source.

Although fsstress was being called with a static path the directory
it was writing to was in the current directory so doing a cd to the
source directory that is made in /tmp and then removing it later
caused it to be unable to write the files in a non-existent dir.

This change gets the current path first and cd's back into it after
it is done compiling fsstress.

Issue #6479.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Alfredo Deza <alfredo.deza@inktank.com>