Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ltsm (0.9.3) unstable; urgency=low

* Added option to set fsname manually

-- Samuel Hasert <s.hasert@gsi.de> Tue, 06 Jan 2026 10:26:20 +0200

ltsm (0.9.2) unstable; urgency=low

* Increased buffersize to 16 MiB
Expand Down
3 changes: 3 additions & 0 deletions rpm/ltsm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ rm -rf %{buildroot}

%changelog

* Tue Jan 06 2026 Samuel Hasert <s.hasert@gsi.de> 0.9.3
- Added option to set fsname manually

* Mon Sep 15 2025 Samuel Hasert <s.hasert@gsi.de> 0.9.2
- Increased buffersize to 16 MiB

Expand Down
14 changes: 12 additions & 2 deletions src/lhsmtool_tsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ static void usage(const char *cmd_name, const int rc)
"\t\t""hostname of tsm server\n"
"\t-c, --conf <file>\n"
"\t\t""option conf file\n"
"\t-f, --fsname\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add the argument? (like with the --conf above?

Suggested change
"\t-f, --fsname\n"
"\t-f, --fsname </override_fs_name>\n"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not this one? Just being curious?

"\t\t""set fsname manually\n"
"\t-v, --verbose {error, warn, message, info, debug}"
" [default: %s]\n"
"\t\t""produce more verbose output\n"
Expand Down Expand Up @@ -297,6 +299,7 @@ static int ct_parseopts(int argc, char *argv[])
{.name = "owner", .has_arg = required_argument, .flag = NULL, .val = 'o'},
{.name = "servername", .has_arg = required_argument, .flag = NULL, .val = 's'},
{.name = "conf", .has_arg = required_argument, .flag = NULL, .val = 'c'},
{.name = "fsname", .has_arg = no_argument, .flag = NULL, .val = 'f'},
{.name = "verbose", .has_arg = required_argument, .flag = NULL, .val = 'v'},
{.name = "dry-run", .has_arg = no_argument, .flag = &opt.o_dry_run, .val = 1},
{.name = "restore-stripe", .has_arg = no_argument, .flag = &opt.o_restore_stripe, .val = 1},
Expand All @@ -308,7 +311,7 @@ static int ct_parseopts(int argc, char *argv[])
int c, rc;
optind = 0;

while ((c = getopt_long(argc, argv, "a:t:n:p:o:s:c:v:h",
while ((c = getopt_long(argc, argv, "a:t:n:p:o:s:c:f:v:h",
long_opts, NULL)) != -1) {
switch (c) {
case 'a': {
Expand Down Expand Up @@ -345,6 +348,11 @@ static int ct_parseopts(int argc, char *argv[])
read_conf(optarg);
break;
}
case 'f': {
strncpy(opt.o_fsname, optarg,
DSM_MAX_FSNAME_LENGTH);
break;
}
case 'v': {
if (OPTNCMP("error", optarg))
opt.o_verbose = API_MSG_ERROR;
Expand Down Expand Up @@ -388,7 +396,9 @@ static int ct_parseopts(int argc, char *argv[])
opt.o_mnt_fd = -1;

/* Filespace name is set to Lustre mount point. */
strncpy(opt.o_fsname, opt.o_mnt, DSM_MAX_FSNAME_LENGTH);
if (!opt.o_fsname[0])
strncpy(opt.o_fsname, opt.o_mnt, DSM_MAX_FSNAME_LENGTH);

const size_t len_fsname = strlen(opt.o_fsname);
if (len_fsname > 2 && opt.o_fsname[len_fsname - 1] == '/')
opt.o_fsname[len_fsname - 1] = '\0';
Expand Down