Previously we could only path_traverse and retry a request or message.
This just allows an explicit context to be used as well. It's the caller's
job to clean it up if we return <= 0.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Apparently, now there's a vertical paragraph space before it,
but that's better than being tacked at the end of the previous
line.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
To ensure consistency, always set the snap context when the header is
updated. If snapid is set, we update librados' snapid when refreshing
the header as well. Also use CEPH_NOSNAP instead of 0 as the default
snapid to prevent confusion. These changes fix snapshot creation
and removal, and prevent writing to a snapshot.
Rollback is fixed by using selfmanaged_snapshot_rollback.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
This was removed in 2cb86f713d, but is
required for selfmanaged snaps because their snapids aren't in the
pool's snap list, which is how regular rollback finds them.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
The tmp directory is removed after each daemon. Previously, this would
break if two daemons were on the same node. Now, the files will be
copied for each daemon.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
is_readable() may need to adjust the write_pos backward, but will return
false. If we are at the end we still need to wake up any waiters so they
know about it.
Signed-off-by: Sage Weil <sage@newdream.net>
md_config_t::parse_argv: fold md_config_t::parse_argv_part2 into
parse_argv. Fix brokenness introduced by the std::string switchover.
OPTION macro: move single-character options out of the OPTION macro and
into config.cc
Fix ceph_argparse_witharg / ceph_argparse_flag uses to include a
trailing (char*)NULL, to ensure that we terminate with a pointer rather
than a 32-bit int.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
The tmp directory is removed after each daemon. Previously, this would
break if two daemons were on the same node. Now, the files will be
copied for each daemon.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
This was consistently breaking stuff for some people, as the acks were
high priority but the commits weren't. They should match.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Use std::string to represent md_config_t strings. This makes memory
management a lot easier and should fix some leaks. "No value" is now
represented by an empty string, whereas before some places were using
empty strings and some were using NULL.
config.cc: Fix a minor decode bug.
In pid_file.cc, copy the pid_file using snprintf, since strncpy
does not always NULL-terminate.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Move parsing into config.cc, since there was already parsing code there.
Move metavariable escaping out of ConfUtils; having this in ConfUtils
makes it impossible to de-globalize g_conf.
Create a nicer API for pulling stuff out of the configuration file.
Since the value we pull is determined by the config structure in effect
at the time, it should be an instance method of md_config_t.
Remove some deadcode. Add some comments.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>