Synopsis
========
-| **rbd-nbd** [-c conf] [--read-only] [--device *nbd device*] [--nbds_max *limit*] [--max_part *limit*] [--exclusive] [--encryption-format *format*] [--encryption-passphrase-file *passphrase-file*] [--io-timeout *seconds*] [--reattach-timeout *seconds*] map *image-spec* | *snap-spec*
+| **rbd-nbd** [-c conf] [--read-only] [--device *nbd device*] [--nbds_max *limit*] [--max_part *limit*] [--exclusive] [--notrim] [--encryption-format *format*] [--encryption-passphrase-file *passphrase-file*] [--io-timeout *seconds*] [--reattach-timeout *seconds*] map *image-spec* | *snap-spec*
| **rbd-nbd** unmap *nbd device* | *image-spec* | *snap-spec*
| **rbd-nbd** list-mapped
| **rbd-nbd** attach --device *nbd device* *image-spec* | *snap-spec*
Forbid writes by other clients.
+.. option:: --notrim
+
+ Turn off trim/discard.
+
.. option:: --encryption-format
Image encryption format.
int reattach_timeout = 30;
bool exclusive = false;
+ bool notrim = false;
bool quiesce = false;
bool readonly = false;
bool set_max_part = false;
<< " (possible values: luks1, luks2)\n"
<< " --encryption-passphrase-file Path of file containing passphrase for unlocking image encryption\n"
<< " --exclusive Forbid writes by other clients\n"
+ << " --notrim Turn off trim/discard\n"
<< " --io-timeout <sec> Set nbd IO timeout\n"
<< " --max_part <limit> Override for module param max_part\n"
<< " --nbds_max <limit> Override for module param nbds_max\n"
if (r < 0)
goto close_fd;
- flags = NBD_FLAG_SEND_FLUSH | NBD_FLAG_SEND_TRIM | NBD_FLAG_HAS_FLAGS;
+ flags = NBD_FLAG_SEND_FLUSH | NBD_FLAG_HAS_FLAGS;
+ if (!cfg->notrim) {
+ flags |= NBD_FLAG_SEND_TRIM;
+ }
if (!cfg->snapname.empty() || cfg->readonly) {
flags |= NBD_FLAG_READ_ONLY;
read_only = 1;
}
} else if (ceph_argparse_flag(args, i, "--exclusive", (char *)NULL)) {
cfg->exclusive = true;
+ } else if (ceph_argparse_flag(args, i, "--notrim", (char *)NULL)) {
+ cfg->notrim = true;
} else if (ceph_argparse_witharg(args, i, &cfg->io_timeout, err,
"--timeout", (char *)NULL)) {
if (!err.str().empty()) {