Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ceph/ceph
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wilkins committed Nov 8, 2013
2 parents 21637cc + 3c70da2 commit 3c91ea1
Show file tree
Hide file tree
Showing 44 changed files with 370 additions and 131 deletions.
13 changes: 12 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AC_PREREQ(2.59)
# VERSION define is not used by the code. It gets a version string
# from 'git describe'; see src/ceph_ver.[ch]

AC_INIT([ceph], [0.72-rc1], [[email protected]])
AC_INIT([ceph], [0.72], [[email protected]])

# Create release string. Used with VERSION for RPMs.
RPM_RELEASE=0
Expand Down Expand Up @@ -539,6 +539,17 @@ AC_CHECK_FUNC([fallocate],
[AC_DEFINE([CEPH_HAVE_FALLOCATE], [], [fallocate(2) is supported])],
[])

#
# Test for time-related `struct stat` members.
#

AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec],
[AC_DEFINE(HAVE_STAT_ST_MTIM_TV_NSEC, 1,
[Define if you have struct stat.st_mtim.tv_nsec])])

AC_CHECK_MEMBER([struct stat.st_mtimespec.tv_nsec],
[AC_DEFINE(HAVE_STAT_ST_MTIMESPEC_TV_NSEC, 1,
[Define if you have struct stat.st_mtimespec.tv_nsec])])

AC_CHECK_HEADERS([arpa/nameser_compat.h])
AC_CHECK_HEADERS([sys/prctl.h])
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ceph (0.72-1) stable; urgency=low

* New upstream release

-- Gary Lowell <[email protected]> Thu, 07 Nov 2013 20:25:18 +0000

ceph (0.72-rc1-1) stable; urgency=low

* New upstream release
Expand Down
6 changes: 6 additions & 0 deletions doc/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,12 @@ v0.69
Upgrading
~~~~~~~~~

* The sysvinit /etc/init.d/ceph script will, by default, update the
CRUSH location of an OSD when it starts. Previously, if the
monitors were not available, this command would hang indefinitely.
Now, that step will time out after 10 seconds and the ceph-osd daemon
will not be started.

* Users of the librados C++ API should replace users of get_version()
with get_version64() as the old method only returns a 32-bit value
for a 64-bit field. The existing 32-bit get_version() method is now
Expand Down
5 changes: 4 additions & 1 deletion qa/run_xfstests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ XFS_MKFS_OPTIONS="-l su=32k"

# Override the default test list with a list of tests known to pass
# until we can work through getting them all passing reliably.
TESTS="1-9 11-15 17 19-21 26-29 31-34 41 46-48 50-54 56 61 63-67 69-70 74-76"
TESTS="1-7 9 11-15 17 19-21 26-29 31-34 41 46-48 50-54 56 61 63-67 69-70 74-76"
TESTS="${TESTS} 78 79 84-89 91-92 100 103 105 108 110 116-121 124 126"
TESTS="${TESTS} 129-135 137-141 164-167 182 184 187-190 192 194"
TESTS="${TESTS} 196 199 201 203 214-216 220-227 234 236-238 241 243-249"
Expand All @@ -59,6 +59,9 @@ TESTS="${TESTS} 253 257-259 261 262 269 273 275 277 278 280 285 286"
######
# Some explanation of why tests have been excluded above:
#
# Test 008 was pulled because it contained a race condition leading to
# spurious failures.
#
# Test 049 was pulled because it caused a kernel fault.
# http://tracker.newdream.net/issues/2260
# Test 232 was pulled because it caused an XFS error
Expand Down
2 changes: 1 addition & 1 deletion qa/run_xfstests_qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ chmod +x run_xfstests.sh
# tests excluded fail in the current testing vm regardless of whether
# rbd is used

./run_xfstests.sh -c 1 -f xfs -t /dev/vdb -s /dev/vdc 1-17 19-26 28-49 51-61 63 66-67 69-79 83 85-105 108-110 112-135 137-170 174-191 193-204 206-217 220-227 230-231 233 235-241 243-249 251-262 264-278 281-286 288-289
./run_xfstests.sh -c 1 -f xfs -t /dev/vdb -s /dev/vdc 1-7 9-17 19-26 28-49 51-61 63 66-67 69-79 83 85-105 108-110 112-135 137-170 174-191 193-204 206-217 220-227 230-231 233 235-241 243-249 251-262 264-278 281-286 288-289
46 changes: 23 additions & 23 deletions src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ using namespace std;
#include "ObjecterWriteback.h"

#include "include/assert.h"
#include "include/stat.h"

#undef dout_prefix
#define dout_prefix *_dout << "client." << whoami << " "
Expand All @@ -109,7 +110,6 @@ Client::CommandHook::CommandHook(Client *client) :
bool Client::CommandHook::call(std::string command, cmdmap_t& cmdmap,
std::string format, bufferlist& out)
{
stringstream ss;
Formatter *f = new_formatter(format);
f->open_object_section("result");
m_client->client_lock.Lock();
Expand Down Expand Up @@ -4503,9 +4503,9 @@ int Client::_setattr(Inode *in, struct stat *attr, int mask, int uid, int gid, I
if (in->caps_issued_mask(CEPH_CAP_FILE_EXCL)) {
if (mask & (CEPH_SETATTR_MTIME|CEPH_SETATTR_ATIME)) {
if (mask & CEPH_SETATTR_MTIME)
in->mtime = utime_t(attr->st_mtim.tv_sec, attr->st_mtim.tv_nsec);
in->mtime = utime_t(stat_get_mtime_sec(attr), stat_get_mtime_nsec(attr));
if (mask & CEPH_SETATTR_ATIME)
in->atime = utime_t(attr->st_atim.tv_sec, attr->st_atim.tv_nsec);
in->atime = utime_t(stat_get_atime_sec(attr), stat_get_atime_nsec(attr));
in->ctime = ceph_clock_now(cct);
in->time_warp_seq++;
mark_caps_dirty(in, CEPH_CAP_FILE_EXCL);
Expand Down Expand Up @@ -4535,14 +4535,14 @@ int Client::_setattr(Inode *in, struct stat *attr, int mask, int uid, int gid, I
req->inode_drop |= CEPH_CAP_AUTH_SHARED;
}
if (mask & CEPH_SETATTR_MTIME) {
req->head.args.setattr.mtime =
utime_t(attr->st_mtim.tv_sec, attr->st_mtim.tv_nsec);
utime_t mtime = utime_t(stat_get_mtime_sec(attr), stat_get_mtime_nsec(attr));
req->head.args.setattr.mtime = mtime;
req->inode_drop |= CEPH_CAP_AUTH_SHARED | CEPH_CAP_FILE_RD |
CEPH_CAP_FILE_WR;
}
if (mask & CEPH_SETATTR_ATIME) {
req->head.args.setattr.atime =
utime_t(attr->st_atim.tv_sec, attr->st_atim.tv_nsec);
utime_t atime = utime_t(stat_get_atime_sec(attr), stat_get_atime_nsec(attr));
req->head.args.setattr.atime = atime;
req->inode_drop |= CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_RD |
CEPH_CAP_FILE_WR;
}
Expand Down Expand Up @@ -4652,16 +4652,16 @@ int Client::fill_stat(Inode *in, struct stat *st, frag_info_t *dirstat, nest_inf
st->st_uid = in->uid;
st->st_gid = in->gid;
if (in->ctime.sec() > in->mtime.sec()) {
st->st_ctim.tv_sec = in->ctime.sec();
st->st_ctim.tv_nsec = in->ctime.nsec();
stat_set_ctime_sec(st, in->ctime.sec());
stat_set_ctime_nsec(st, in->ctime.nsec());
} else {
st->st_ctim.tv_sec = in->mtime.sec();
st->st_ctim.tv_nsec = in->mtime.nsec();
stat_set_ctime_sec(st, in->mtime.sec());
stat_set_ctime_nsec(st, in->mtime.nsec());
}
st->st_atim.tv_sec = in->atime.sec();
st->st_atim.tv_nsec = in->atime.nsec();
st->st_mtim.tv_sec = in->mtime.sec();
st->st_mtim.tv_nsec = in->mtime.nsec();
stat_set_atime_sec(st, in->atime.sec());
stat_set_atime_nsec(st, in->atime.nsec());
stat_set_mtime_sec(st, in->mtime.sec());
stat_set_mtime_nsec(st, in->mtime.nsec());
if (in->is_dir()) {
//st->st_size = in->dirstat.size();
st->st_size = in->rstat.rbytes;
Expand Down Expand Up @@ -4807,10 +4807,10 @@ int Client::utime(const char *relpath, struct utimbuf *buf)
if (r < 0)
return r;
struct stat attr;
attr.st_mtim.tv_sec = buf->modtime;
attr.st_mtim.tv_nsec = 0;
attr.st_atim.tv_sec = buf->actime;
attr.st_atim.tv_nsec = 0;
stat_set_mtime_sec(&attr, buf->modtime);
stat_set_mtime_nsec(&attr, 0);
stat_set_atime_sec(&attr, buf->actime);
stat_set_atime_nsec(&attr, 0);
return _setattr(in, &attr, CEPH_SETATTR_MTIME|CEPH_SETATTR_ATIME);
}

Expand All @@ -4828,10 +4828,10 @@ int Client::lutime(const char *relpath, struct utimbuf *buf)
if (r < 0)
return r;
struct stat attr;
attr.st_mtim.tv_sec = buf->modtime;
attr.st_mtim.tv_nsec = 0;
attr.st_atim.tv_sec = buf->actime;
attr.st_atim.tv_nsec = 0;
stat_set_mtime_sec(&attr, buf->modtime);
stat_set_mtime_nsec(&attr, 0);
stat_set_atime_sec(&attr, buf->actime);
stat_set_atime_nsec(&attr, 0);
return _setattr(in, &attr, CEPH_SETATTR_MTIME|CEPH_SETATTR_ATIME);
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ void buffer::list::rebuild_page_aligned()
return 0; // no buffers

std::list<ptr>::const_iterator iter = _buffers.begin();
iter++;
++iter;

if (iter != _buffers.end())
rebuild();
Expand Down
5 changes: 5 additions & 0 deletions src/common/hobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ struct hobject_t {
return ret;
}

/// @return true if object is snapdir
bool is_snapdir() const {
return snap == CEPH_SNAPDIR;
}

/// @return snapdir version of this hobject_t
hobject_t get_snapdir() const {
hobject_t ret(*this);
Expand Down
5 changes: 5 additions & 0 deletions src/common/sharedptr_registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ class SharedPtrRegistry {
return retval;
}

unsigned size() {
Mutex::Locker l(lock);
return contents.size();
}

void remove(const K &key) {
Mutex::Locker l(lock);
contents.erase(key);
Expand Down
3 changes: 2 additions & 1 deletion src/include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ noinst_HEADERS += \
include/rbd/features.h \
include/rbd/librbd.h \
include/rbd/librbd.hpp\
include/util.h
include/util.h\
include/stat.h
145 changes: 145 additions & 0 deletions src/include/stat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
#ifndef CEPH_STAT_H
#define CEPH_STAT_H

#include <acconfig.h>

#include <sys/stat.h>

/*
* Access time-related `struct stat` members.
*
* Note that for each of the stat member get/set functions below, setting a
* high-res value (stat_set_*_nsec) on a platform without high-res support is
* a no-op.
*/

#ifdef HAVE_STAT_ST_MTIM_TV_NSEC

static inline uint32_t stat_get_mtime_nsec(struct stat *st)
{
return st->st_mtim.tv_nsec;
}

static inline void stat_set_mtime_nsec(struct stat *st, uint32_t nsec)
{
st->st_mtim.tv_nsec = nsec;
}

static inline uint32_t stat_get_atime_nsec(struct stat *st)
{
return st->st_atim.tv_nsec;
}

static inline void stat_set_atime_nsec(struct stat *st, uint32_t nsec)
{
st->st_atim.tv_nsec = nsec;
}

static inline uint32_t stat_get_ctime_nsec(struct stat *st)
{
return st->st_ctim.tv_nsec;
}

static inline void stat_set_ctime_nsec(struct stat *st, uint32_t nsec)
{
st->st_ctim.tv_nsec = nsec;
}

#elif defined(HAVE_STAT_ST_MTIMESPEC_TV_NSEC)

static inline uint32_t stat_get_mtime_nsec(struct stat *st)
{
return st->st_mtimespec.tv_nsec;
}

static inline void stat_set_mtime_nsec(struct stat *st, uint32_t nsec)
{
st->st_mtimespec.tv_nsec = nsec;
}

static inline uint32_t stat_get_atime_nsec(struct stat *st)
{
return st->st_atimespec.tv_nsec;
}

static inline void stat_set_atime_nsec(struct stat *st, uint32_t nsec)
{
st->st_atimespec.tv_nsec = nsec;
}

static inline uint32_t stat_get_ctime_nsec(struct stat *st)
{
return st->st_ctimespec.tv_nsec;
}

static inline void stat_set_ctime_nsec(struct stat *st, uint32_t nsec)
{
st->st_ctimespec.tv_nsec = nsec;
}

#else

static inline uint32_t stat_get_mtime_nsec(struct stat *st)
{
return 0;
}

static inline void stat_set_mtime_nsec(struct stat *st, uint32_t nsec)
{
}

static inline uint32_t stat_get_atime_nsec(struct stat *st)
{
return 0;
}

static inline void stat_set_atime_nsec(struct stat *st, uint32_t nsec)
{
}

static inline uint32_t stat_get_ctime_nsec(struct stat *st)
{
return 0;
}

static inline void stat_set_ctime_nsec(struct stat *st, uint32_t nsec)
{
}

#endif

/*
* Access second-resolution `struct stat` members.
*/

static inline uint32_t stat_get_mtime_sec(struct stat *st)
{
return st->st_mtime;
}

static inline void stat_set_mtime_sec(struct stat *st, uint32_t sec)
{
st->st_mtime = sec;
}

static inline uint32_t stat_get_atime_sec(struct stat *st)
{
return st->st_atime;
}

static inline void stat_set_atime_sec(struct stat *st, uint32_t sec)
{
st->st_atime = sec;
}

static inline uint32_t stat_get_ctime_sec(struct stat *st)
{
return st->st_ctime;
}

static inline void stat_set_ctime_sec(struct stat *st, uint32_t sec)
{
st->st_ctime = sec;
}

#endif
2 changes: 0 additions & 2 deletions src/mon/MDSMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ bool MDSMonitor::preprocess_command(MMonCommand *m)
}
r = 0;
} else if (prefix == "mds dump") {
string val;
int64_t epocharg;
epoch_t epoch;

Expand Down Expand Up @@ -633,7 +632,6 @@ bool MDSMonitor::preprocess_command(MMonCommand *m)
} else if (prefix == "mds tell") {
string whostr;
cmd_getval(g_ceph_context, cmdmap, "who", whostr);
string args;
vector<string>args_vec;
cmd_getval(g_ceph_context, cmdmap, "args", args_vec);

Expand Down
Loading

0 comments on commit 3c91ea1

Please sign in to comment.