Displaying 6 results from an estimated 6 matches for "plugin_rb_zero".
2017 Feb 02
0
[nbdkit PATCH 2/2] ruby: Support zero callback
...VALUE
set_error(VALUE self, VALUE arg)
@@ -58,6 +60,7 @@ set_error(VALUE self, VALUE arg)
} else {
err = NUM2INT(arg);
}
+ last_error = err;
nbdkit_set_error(err);
return Qnil;
}
@@ -367,6 +370,30 @@ plugin_rb_trim (void *handle, uint32_t count, uint64_t offset)
}
static int
+plugin_rb_zero (void *handle, uint32_t count, uint64_t offset, int may_trim)
+{
+ volatile VALUE argv[4];
+
+ argv[0] = (VALUE) handle;
+ argv[1] = ULL2NUM (count);
+ argv[2] = ULL2NUM (offset);
+ argv[3] = may_trim ? Qtrue : Qfalse;
+ exception_happened = 0;
+ last_error = 0;
+ (void) funcall2 (Qnil, rb_...
2017 Feb 02
3
[nbdkit PATCH 0/2] Ruby bindings for .zero
Similar to python and perl. But MUCH easier (especially considering
that this is the first time I've every tried to run Ruby). I even
had fun making set_error() polymorphic.
Eric Blake (2):
ruby: Expose nbdkit_set_error to ruby script
ruby: Support zero callback
plugins/ruby/example.rb | 11 ++++++++
plugins/ruby/nbdkit-ruby-plugin.pod | 54
2019 Aug 13
0
[nbdkit PATCH 2/2] plugins: Permit ENOTSUP as synonym for EOPNOTSUPP
...ests this particular error, we want to
gracefully fall back, and to accomodate both a normal return
and an exception. */
diff --git a/plugins/ruby/ruby.c b/plugins/ruby/ruby.c
index b31f6a4e..ff7932c4 100644
--- a/plugins/ruby/ruby.c
+++ b/plugins/ruby/ruby.c
@@ -420,7 +420,7 @@ plugin_rb_zero (void *handle, uint32_t count, uint64_t offset, int may_trim)
argv[3] = may_trim ? Qtrue : Qfalse;
last_error = 0;
(void) funcall2 (Qnil, rb_intern ("zero"), 4, argv, &exception_happened);
- if (last_error == EOPNOTSUPP ||
+ if (last_error == EOPNOTSUPP || last_error == ENO...
2019 Aug 13
3
[nbdkit PATCH 0/2] errno cleanup patches
I ran into these while trying to prepare patches to add
NBD_CMD_FLAG_FAST_ZERO, which will expose a new NBD_ENOTSUP wire
value.
Eric Blake (2):
plugins: Don't lose original error when emulating FUA
plugins: Permit ENOTSUP as synonym for EOPNOTSUPP
docs/nbdkit-filter.pod | 11 ++++++-----
docs/nbdkit-plugin.pod | 12 +++++++-----
plugins/file/file.c | 16 +++++++++++-----
2017 Feb 06
0
[PATCH 1/2] Define .errno_is_preserved constant instead of a .errno_is_reliable callback.
...;FILENAME> (required) The Ruby plugin to run.\n" \
"[other arguments may be used by the plugin that you load]"
@@ -511,8 +501,6 @@ static struct nbdkit_plugin plugin = {
.flush = plugin_rb_flush,
.trim = plugin_rb_trim,
.zero = plugin_rb_zero,
-
- .errno_is_reliable = plugin_rb_errno_is_reliable,
};
NBDKIT_REGISTER_PLUGIN(plugin)
diff --git a/src/connections.c b/src/connections.c
index cf06ac5..a0d689a 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -498,10 +498,7 @@ negotiate_handshake (struct connection *conn)
int r;...
2017 Feb 06
3
[PATCH nbdkit 0/2] Change .errno_is_reliable function to .errno_is_preserved constant.
See patch 1 for rationale.