Skip to content

Commit dce31f8

Browse files
Windows support (#520)
Co-authored-by: José Iván Orozco Torrez <47061294+vandelvan@users.noreply.github.com>
1 parent 0971dec commit dce31f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1152
-700
lines changed

src/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ nobase_pkginclude_HEADERS = \
122122
libltfs/arch/arch_info.h \
123123
libltfs/arch/time_internal.h \
124124
libltfs/arch/errormap.h \
125+
libltfs/arch/ltfs_arch_ops.h \
125126
tape_drivers/ibm_tape.h \
126127
tape_drivers/spc_op_codes.h \
127128
tape_drivers/ssc_op_codes.h \

src/iosched/cache_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions

src/iosched/cache_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions

src/iosched/fcfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions

src/iosched/unified.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions
@@ -1742,7 +1742,7 @@ ssize_t _unified_insert_new_request(const char *buf, off_t offset, size_t count,
17421742
{
17431743
int ret;
17441744
struct dentry_priv *dpr = d->iosched_priv;
1745-
struct write_request *new_req;
1745+
struct write_request *new_req = NULL;
17461746
size_t copy_count;
17471747

17481748
if (! (*cache)) {
@@ -1764,7 +1764,7 @@ ssize_t _unified_insert_new_request(const char *buf, off_t offset, size_t count,
17641764
memcpy(cache_manager_get_object_data(*cache), buf, copy_count);
17651765

17661766
/* Store new write request */
1767-
new_req = calloc(1, sizeof(struct write_request));
1767+
new_req = (struct write_request*)calloc(1, sizeof(struct write_request));
17681768
if (! new_req) {
17691769
ltfsmsg(LTFS_ERR, 13018E);
17701770
_unified_cache_free(*cache, 0, priv);
@@ -2307,7 +2307,7 @@ int unified_set_profiler(char *work_dir, bool enable, void *iosched_handle)
23072307
{
23082308
int rc = 0;
23092309
char *path;
2310-
FILE *p;
2310+
FILE * p = NULL;
23112311
struct timer_info timerinfo;
23122312
struct unified_data *priv = iosched_handle;
23132313

@@ -2325,7 +2325,7 @@ int unified_set_profiler(char *work_dir, bool enable, void *iosched_handle)
23252325
return -LTFS_NO_MEMORY;
23262326
}
23272327

2328-
p = fopen(path, PROFILER_FILE_MODE);
2328+
arch_fopen(path, PROFILER_FILE_MODE,p);
23292329

23302330
free(path);
23312331

src/kmi/flatfile.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions
@@ -51,11 +51,12 @@
5151
#include <errno.h>
5252
#include "libltfs/kmi_ops.h"
5353
#include "libltfs/ltfs_fuse_version.h"
54-
#include <fuse.h>
55-
#include "key_format_ltfs.h"
5654

55+
#include "key_format_ltfs.h"
56+
#include <fuse.h>
5757
#ifdef mingw_PLATFORM
58-
#include "libltfs/arch/win/win_util.h"
58+
#include "arch/win/win_util.h"
59+
5960
#endif
6061

6162
struct kmi_flatfile_options_data {

src/kmi/key_format_ltfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions
@@ -48,7 +48,7 @@
4848
*/
4949

5050
#ifdef mingw_PLATFORM
51-
#include "libltfs/arch/win/win_util.h"
51+
#include "arch/win/win_util.h"
5252
#endif
5353
#include "libltfs/ltfs.h"
5454
#include "libltfs/base64.h"

src/kmi/key_format_ltfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions

src/kmi/simple.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions
@@ -49,11 +49,11 @@
4949

5050
#include "libltfs/kmi_ops.h"
5151
#include "libltfs/ltfs_fuse_version.h"
52-
#include <fuse.h>
5352
#include "key_format_ltfs.h"
54-
53+
#include <fuse.h>
5554
#ifdef mingw_PLATFORM
56-
#include "libltfs/arch/win/win_util.h"
55+
#include "arch/win/win_util.h"
56+
5757
#endif
5858

5959
struct kmi_simple_options_data {
@@ -193,20 +193,20 @@ int simple_parse_opts(void *opt_args)
193193
+ strlen((char *) key[i].dk) + strlen(":") + strlen((char *) key[i].dki) + 1;
194194

195195
if (priv.dk_list)
196-
priv.dk_list = realloc(priv.dk_list, dk_list_len);
196+
priv.dk_list = (unsigned char*)realloc(priv.dk_list, dk_list_len);
197197
else
198-
priv.dk_list = calloc(dk_list_len, sizeof(unsigned char));
198+
priv.dk_list = (unsigned char*)calloc(dk_list_len, sizeof(unsigned char));
199199
if (priv.dk_list == NULL) {
200200
ltfsmsg(LTFS_ERR, 10001E, __FUNCTION__);
201201
return -LTFS_NO_MEMORY;
202202
}
203203
*(priv.dk_list + original_dk_list_len) = '\0';
204204

205205
if (original_dk_list_len)
206-
strcat((char *) priv.dk_list, "/");
207-
strcat((char *) priv.dk_list, (char *) key[i].dk);
208-
strcat((char *) priv.dk_list, ":");
209-
strcat((char *) priv.dk_list, (char *) key[i].dki);
206+
arch_strcat((char *) priv.dk_list, dk_list_len, "/");
207+
arch_strcat((char *) priv.dk_list, dk_list_len,(char *) key[i].dk);
208+
arch_strcat((char *) priv.dk_list, dk_list_len, ":");
209+
arch_strcat((char *) priv.dk_list, dk_list_len,(char *) key[i].dki);
210210
}
211211

212212
return 0;

src/libltfs/arch/arch_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2021 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions

0 commit comments

Comments
 (0)