@zenfs/core 1.11.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backends/backend.d.ts +19 -15
- package/dist/backends/backend.js +36 -19
- package/dist/backends/cow.d.ts +20 -30
- package/dist/backends/cow.js +83 -192
- package/dist/backends/fetch.d.ts +1 -0
- package/dist/backends/fetch.js +30 -30
- package/dist/backends/index.d.ts +1 -1
- package/dist/backends/index.js +1 -1
- package/dist/backends/memory.d.ts +5 -7
- package/dist/backends/memory.js +2 -3
- package/dist/backends/passthrough.d.ts +19 -23
- package/dist/backends/passthrough.js +98 -288
- package/dist/backends/port.d.ts +220 -0
- package/dist/backends/port.js +328 -0
- package/dist/backends/single_buffer.d.ts +59 -47
- package/dist/backends/single_buffer.js +468 -219
- package/dist/backends/store/fs.d.ts +25 -35
- package/dist/backends/store/fs.js +276 -315
- package/dist/backends/store/store.d.ts +10 -15
- package/dist/backends/store/store.js +11 -10
- package/dist/config.d.ts +3 -12
- package/dist/config.js +17 -19
- package/dist/context.d.ts +8 -21
- package/dist/context.js +33 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/internal/contexts.d.ts +63 -0
- package/dist/internal/contexts.js +15 -0
- package/dist/internal/credentials.d.ts +2 -11
- package/dist/internal/credentials.js +0 -19
- package/dist/internal/devices.d.ts +18 -80
- package/dist/internal/devices.js +103 -316
- package/dist/internal/error.d.ts +9 -204
- package/dist/internal/error.js +19 -288
- package/dist/internal/file_index.d.ts +1 -1
- package/dist/internal/file_index.js +11 -11
- package/dist/internal/filesystem.d.ts +51 -94
- package/dist/internal/filesystem.js +21 -20
- package/dist/internal/index.d.ts +1 -2
- package/dist/internal/index.js +1 -2
- package/dist/internal/index_fs.d.ts +12 -30
- package/dist/internal/index_fs.js +37 -69
- package/dist/internal/inode.d.ts +140 -24
- package/dist/internal/inode.js +515 -66
- package/dist/mixins/async.js +52 -112
- package/dist/mixins/mutexed.d.ts +19 -18
- package/dist/mixins/mutexed.js +62 -64
- package/dist/mixins/readonly.d.ts +7 -6
- package/dist/mixins/readonly.js +24 -18
- package/dist/mixins/sync.js +8 -8
- package/dist/{vfs/path.d.ts → path.d.ts} +3 -4
- package/dist/{vfs/path.js → path.js} +6 -9
- package/dist/polyfills.js +1 -1
- package/dist/readline.d.ts +134 -0
- package/dist/readline.js +623 -0
- package/dist/utils.d.ts +9 -37
- package/dist/utils.js +17 -85
- package/dist/vfs/acl.d.ts +42 -0
- package/dist/vfs/acl.js +268 -0
- package/dist/vfs/async.d.ts +9 -23
- package/dist/vfs/async.js +25 -27
- package/dist/vfs/config.d.ts +6 -18
- package/dist/vfs/config.js +8 -18
- package/dist/vfs/dir.d.ts +3 -3
- package/dist/vfs/dir.js +12 -12
- package/dist/vfs/file.d.ts +106 -0
- package/dist/vfs/file.js +244 -0
- package/dist/vfs/flags.d.ts +19 -0
- package/dist/vfs/flags.js +62 -0
- package/dist/vfs/index.d.ts +4 -10
- package/dist/vfs/index.js +4 -13
- package/dist/vfs/ioctl.d.ts +88 -0
- package/dist/vfs/ioctl.js +409 -0
- package/dist/vfs/promises.d.ts +81 -19
- package/dist/vfs/promises.js +404 -288
- package/dist/vfs/shared.d.ts +7 -37
- package/dist/vfs/shared.js +29 -85
- package/dist/{stats.d.ts → vfs/stats.d.ts} +14 -28
- package/dist/{stats.js → vfs/stats.js} +11 -66
- package/dist/vfs/streams.d.ts +1 -0
- package/dist/vfs/streams.js +32 -27
- package/dist/vfs/sync.d.ts +3 -3
- package/dist/vfs/sync.js +263 -260
- package/dist/vfs/watchers.d.ts +2 -2
- package/dist/vfs/watchers.js +12 -12
- package/dist/vfs/xattr.d.ts +116 -0
- package/dist/vfs/xattr.js +201 -0
- package/package.json +5 -3
- package/readme.md +1 -1
- package/scripts/test.js +2 -2
- package/tests/assignment.ts +1 -1
- package/tests/backend/config.worker.js +4 -1
- package/tests/backend/fetch.test.ts +3 -0
- package/tests/backend/port.test.ts +19 -33
- package/tests/backend/remote.worker.js +4 -1
- package/tests/backend/single-buffer.test.ts +53 -0
- package/tests/backend/single-buffer.worker.js +30 -0
- package/tests/common/context.test.ts +3 -3
- package/tests/common/handle.test.ts +17 -12
- package/tests/common/mutex.test.ts +9 -9
- package/tests/common/path.test.ts +1 -1
- package/tests/common/readline.test.ts +104 -0
- package/tests/common.ts +4 -19
- package/tests/fetch/fetch.ts +2 -2
- package/tests/fs/append.test.ts +4 -4
- package/tests/fs/directory.test.ts +25 -25
- package/tests/fs/errors.test.ts +15 -19
- package/tests/fs/links.test.ts +4 -3
- package/tests/fs/open.test.ts +4 -21
- package/tests/fs/permissions.test.ts +14 -18
- package/tests/fs/read.test.ts +10 -9
- package/tests/fs/readFile.test.ts +10 -26
- package/tests/fs/rename.test.ts +4 -9
- package/tests/fs/stat.test.ts +8 -8
- package/tests/fs/streams.test.ts +2 -11
- package/tests/fs/times.test.ts +7 -7
- package/tests/fs/truncate.test.ts +8 -36
- package/tests/fs/watch.test.ts +10 -10
- package/tests/fs/write.test.ts +77 -13
- package/tests/fs/xattr.test.ts +85 -0
- package/tests/logs.js +22 -0
- package/tests/setup/context.ts +1 -1
- package/tests/setup/index.ts +3 -3
- package/tests/setup/port.ts +7 -1
- package/dist/backends/port/fs.d.ts +0 -84
- package/dist/backends/port/fs.js +0 -151
- package/dist/backends/port/rpc.d.ts +0 -77
- package/dist/backends/port/rpc.js +0 -100
- package/dist/backends/store/simple.d.ts +0 -20
- package/dist/backends/store/simple.js +0 -13
- package/dist/internal/file.d.ts +0 -359
- package/dist/internal/file.js +0 -751
- package/dist/internal/log.d.ts +0 -133
- package/dist/internal/log.js +0 -218
- package/tests/fs/writeFile.test.ts +0 -70
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { withErrno } from 'kerium';
|
|
2
|
+
import * as c from './constants.js';
|
|
3
|
+
export const pattern = /[rwasx]{1,2}\+?/;
|
|
4
|
+
/**
|
|
5
|
+
* @internal @hidden
|
|
6
|
+
*/
|
|
7
|
+
export function parse(flag) {
|
|
8
|
+
if (typeof flag == 'number')
|
|
9
|
+
return flag;
|
|
10
|
+
if (!pattern.test(flag)) {
|
|
11
|
+
throw withErrno('EINVAL', 'Invalid flag string: ' + flag);
|
|
12
|
+
}
|
|
13
|
+
return toNumber(flag);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @internal @hidden
|
|
17
|
+
*/
|
|
18
|
+
export function toString(flag) {
|
|
19
|
+
let string = flag & c.O_RDONLY ? 'r' : flag & c.O_APPEND ? 'a' : flag & c.O_TRUNC ? 'w' : '';
|
|
20
|
+
if (flag & c.O_SYNC)
|
|
21
|
+
string += 's';
|
|
22
|
+
if (flag & c.O_EXCL)
|
|
23
|
+
string += 'x';
|
|
24
|
+
if (flag & c.O_RDWR)
|
|
25
|
+
string += '+';
|
|
26
|
+
return string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @internal @hidden
|
|
30
|
+
*/
|
|
31
|
+
export function toNumber(flag) {
|
|
32
|
+
if (!flag.includes('r') && !flag.includes('w') && !flag.includes('a')) {
|
|
33
|
+
throw withErrno('EINVAL', 'Invalid flag string: ' + flag);
|
|
34
|
+
}
|
|
35
|
+
let n = flag.includes('r') ? c.O_RDONLY : c.O_CREAT;
|
|
36
|
+
if (flag.includes('w'))
|
|
37
|
+
n |= c.O_TRUNC;
|
|
38
|
+
if (flag.includes('a'))
|
|
39
|
+
n |= c.O_APPEND;
|
|
40
|
+
if (flag.includes('+'))
|
|
41
|
+
n |= c.O_RDWR;
|
|
42
|
+
else if (!flag.includes('r'))
|
|
43
|
+
n |= c.O_WRONLY;
|
|
44
|
+
if (flag.includes('s'))
|
|
45
|
+
n |= c.O_SYNC;
|
|
46
|
+
if (flag.includes('x'))
|
|
47
|
+
n |= c.O_EXCL;
|
|
48
|
+
return n;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parses a flag as a mode (W_OK, R_OK, and/or X_OK)
|
|
52
|
+
* @param flag the flag to parse
|
|
53
|
+
* @internal @hidden
|
|
54
|
+
*/
|
|
55
|
+
export function toMode(flag) {
|
|
56
|
+
let mode = 0;
|
|
57
|
+
if (!(flag & c.O_WRONLY))
|
|
58
|
+
mode |= c.R_OK;
|
|
59
|
+
if (flag & c.O_WRONLY || flag & c.O_RDWR)
|
|
60
|
+
mode |= c.W_OK;
|
|
61
|
+
return mode;
|
|
62
|
+
}
|
package/dist/vfs/index.d.ts
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
export { BigIntStatsFs, Stats, StatsFs } from '../stats.js';
|
|
2
1
|
export * from './async.js';
|
|
3
2
|
export * as constants from './constants.js';
|
|
4
3
|
export * from './dir.js';
|
|
4
|
+
export * from './ioctl.js';
|
|
5
5
|
export * as promises from './promises.js';
|
|
6
|
-
export { chroot, mount,
|
|
7
|
-
|
|
8
|
-
* The map of mount points.
|
|
9
|
-
* Using `fs.mounts` instead of the `mounts` export is a security issue and not recommended.
|
|
10
|
-
* The deprecation here propagates to the correct `mounts` export for some reason.
|
|
11
|
-
* @todo [BREAKING] remove `fs.mounts` for security.
|
|
12
|
-
* @deprecated Use the `mounts` export that isn't an `fs` property!
|
|
13
|
-
*/
|
|
14
|
-
mounts, umount, } from './shared.js';
|
|
6
|
+
export { chroot, mount, umount } from './shared.js';
|
|
7
|
+
export { BigIntStatsFs, Stats, StatsFs } from './stats.js';
|
|
15
8
|
export * from './streams.js';
|
|
16
9
|
export * from './sync.js';
|
|
10
|
+
export * as xattr from './xattr.js';
|
package/dist/vfs/index.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
export { BigIntStatsFs, Stats, StatsFs } from '../stats.js';
|
|
2
1
|
export * from './async.js';
|
|
3
2
|
export * as constants from './constants.js';
|
|
4
3
|
export * from './dir.js';
|
|
4
|
+
export * from './ioctl.js';
|
|
5
5
|
export * as promises from './promises.js';
|
|
6
|
-
export { chroot, mount,
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The map of mount points.
|
|
10
|
-
* Using `fs.mounts` instead of the `mounts` export is a security issue and not recommended.
|
|
11
|
-
* The deprecation here propagates to the correct `mounts` export for some reason.
|
|
12
|
-
* @todo [BREAKING] remove `fs.mounts` for security.
|
|
13
|
-
* @deprecated Use the `mounts` export that isn't an `fs` property!
|
|
14
|
-
*/
|
|
15
|
-
mounts,
|
|
16
|
-
/* node:coverage enable */
|
|
17
|
-
umount, } from './shared.js';
|
|
6
|
+
export { chroot, mount, umount } from './shared.js';
|
|
7
|
+
export { BigIntStatsFs, Stats, StatsFs } from './stats.js';
|
|
18
8
|
export * from './streams.js';
|
|
19
9
|
export * from './sync.js';
|
|
10
|
+
export * as xattr from './xattr.js';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { BufferView } from 'utilium/buffer.js';
|
|
2
|
+
import type { V_Context } from '../context.js';
|
|
3
|
+
import { Inode } from '../internal/inode.js';
|
|
4
|
+
declare class fsxattr extends BufferView {
|
|
5
|
+
/** xflags field value */
|
|
6
|
+
accessor xflags: number;
|
|
7
|
+
/** extsize field value */
|
|
8
|
+
accessor extsize: number;
|
|
9
|
+
/** nextents field value */
|
|
10
|
+
accessor nextents: number;
|
|
11
|
+
/** project identifier */
|
|
12
|
+
accessor projid: number;
|
|
13
|
+
/** CoW extsize field value */
|
|
14
|
+
accessor cowextsize: number;
|
|
15
|
+
protected accessor pad: number[];
|
|
16
|
+
constructor(inode?: Inode);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* `FS_IOC_*` commands for {@link ioctl | `ioctl`}
|
|
20
|
+
* @remarks
|
|
21
|
+
* These are computed from a script since constant values are needed for enum member types
|
|
22
|
+
*/
|
|
23
|
+
export declare enum IOC {
|
|
24
|
+
GetFlags = 2148034049,
|
|
25
|
+
SetFlags = 1074292226,
|
|
26
|
+
GetVersion = 2148038145,
|
|
27
|
+
SetVersion = 1074296322,
|
|
28
|
+
Fiemap = 3223348747,
|
|
29
|
+
GetXattr = 2149341215,
|
|
30
|
+
SetXattr = 1075599392,
|
|
31
|
+
GetLabel = 2164298801,
|
|
32
|
+
SetLabel = 1090556978,
|
|
33
|
+
GetUUID = 2148603136,
|
|
34
|
+
GetSysfsPath = 2155943169
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `FS_IOC32_*` commands for {@link ioctl | `ioctl`}
|
|
38
|
+
* @remarks
|
|
39
|
+
* These are computed from a script since constant values are needed for enum member types
|
|
40
|
+
*/
|
|
41
|
+
export declare enum IOC32 {
|
|
42
|
+
GetFlags = 2147771905,
|
|
43
|
+
SetFlags = 1074030082,
|
|
44
|
+
GetVersion = 2147776001,
|
|
45
|
+
SetVersion = 1074034178
|
|
46
|
+
}
|
|
47
|
+
/** Used by `ioctl` for type inference */
|
|
48
|
+
interface _ioc_ops {
|
|
49
|
+
[IOC.GetFlags](): number;
|
|
50
|
+
[IOC.SetFlags](flags: number): void;
|
|
51
|
+
[IOC.GetVersion](): number;
|
|
52
|
+
[IOC.SetVersion](version: number): void;
|
|
53
|
+
[IOC.Fiemap](): never;
|
|
54
|
+
[IOC.GetXattr](name: string): fsxattr;
|
|
55
|
+
[IOC.SetXattr](name: string, value: fsxattr): never;
|
|
56
|
+
[IOC.GetLabel](): string;
|
|
57
|
+
[IOC.SetLabel](label: string): void;
|
|
58
|
+
[IOC.GetUUID](): string;
|
|
59
|
+
[IOC.GetSysfsPath](): string;
|
|
60
|
+
}
|
|
61
|
+
/** Used by `ioctl` for type inference */
|
|
62
|
+
interface _ioc32_ops extends Record<keyof IOC32, (...args: any[]) => any> {
|
|
63
|
+
[IOC32.GetFlags](): number;
|
|
64
|
+
[IOC32.SetFlags](flags: number): void;
|
|
65
|
+
[IOC32.GetVersion](): number;
|
|
66
|
+
[IOC32.SetVersion](version: number): void;
|
|
67
|
+
}
|
|
68
|
+
/** Used by `ioctl` for type inference */
|
|
69
|
+
type __ioctl_args__<T extends number> = T extends IOC ? Parameters<_ioc_ops[T]> : T extends IOC32 ? Parameters<_ioc32_ops[T]> : any[];
|
|
70
|
+
/** Used by `ioctl` for type inference */
|
|
71
|
+
type __ioctl_return__<T extends number> = T extends IOC ? ReturnType<_ioc_ops[T]> : T extends IOC32 ? ReturnType<_ioc32_ops[T]> : any;
|
|
72
|
+
/** Perform an `ioctl` on a file or file system. */
|
|
73
|
+
export declare function ioctl<const Command extends number, const Args extends __ioctl_args__<Command>, const Return extends __ioctl_return__<Command>>(this: V_Context,
|
|
74
|
+
/** The path to the file or file system to perform the `ioctl` on */
|
|
75
|
+
path: string,
|
|
76
|
+
/** The command to perform (uint32) */
|
|
77
|
+
command: Command,
|
|
78
|
+
/** The arguments to pass to the command */
|
|
79
|
+
...args: Args): Promise<Return>;
|
|
80
|
+
/** Perform an `ioctl` on a file or file system */
|
|
81
|
+
export declare function ioctlSync<const Command extends number, const Args extends __ioctl_args__<Command>, const Return extends __ioctl_return__<Command>>(this: V_Context,
|
|
82
|
+
/** The path to the file or file system to perform the `ioctl` on */
|
|
83
|
+
path: string,
|
|
84
|
+
/** The command to perform (uint32) */
|
|
85
|
+
command: Command,
|
|
86
|
+
/** The arguments to pass to the command */
|
|
87
|
+
...args: Args): Return;
|
|
88
|
+
export {};
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
/*
|
|
2
|
+
ioctl stuff. The majority of the code here is ported from Linux
|
|
3
|
+
See:
|
|
4
|
+
- include/uapi/asm-generic/ioctl.h
|
|
5
|
+
- include/uapi/linux/fs.h (`FS_IOC_*`)
|
|
6
|
+
*/
|
|
7
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
8
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
9
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
10
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
11
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
12
|
+
var _, done = false;
|
|
13
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
14
|
+
var context = {};
|
|
15
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
16
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
17
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
18
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
19
|
+
if (kind === "accessor") {
|
|
20
|
+
if (result === void 0) continue;
|
|
21
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
22
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
23
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
24
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
25
|
+
}
|
|
26
|
+
else if (_ = accept(result)) {
|
|
27
|
+
if (kind === "field") initializers.unshift(_);
|
|
28
|
+
else descriptor[key] = _;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
32
|
+
done = true;
|
|
33
|
+
};
|
|
34
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
35
|
+
var useValue = arguments.length > 2;
|
|
36
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
37
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
38
|
+
}
|
|
39
|
+
return useValue ? value : void 0;
|
|
40
|
+
};
|
|
41
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
42
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
43
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
44
|
+
};
|
|
45
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
46
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
47
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
48
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
49
|
+
};
|
|
50
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
51
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
52
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
53
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
54
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
55
|
+
};
|
|
56
|
+
import { Errno, Exception, setUVMessage, UV } from 'kerium';
|
|
57
|
+
import { sizeof, struct, types as t } from 'memium';
|
|
58
|
+
import { _throw } from 'utilium';
|
|
59
|
+
import { BufferView } from 'utilium/buffer.js';
|
|
60
|
+
import { Inode, InodeFlags } from '../internal/inode.js';
|
|
61
|
+
import { normalizePath } from '../utils.js';
|
|
62
|
+
import { resolveMount } from './shared.js';
|
|
63
|
+
/*
|
|
64
|
+
* Flags for the fsxattr.xflags field
|
|
65
|
+
*/
|
|
66
|
+
var XFlag;
|
|
67
|
+
(function (XFlag) {
|
|
68
|
+
/** data in realtime volume */
|
|
69
|
+
XFlag[XFlag["RealTime"] = 1] = "RealTime";
|
|
70
|
+
/** preallocated file extents */
|
|
71
|
+
XFlag[XFlag["PreAlloc"] = 2] = "PreAlloc";
|
|
72
|
+
/** file cannot be modified */
|
|
73
|
+
XFlag[XFlag["Immutable"] = 8] = "Immutable";
|
|
74
|
+
/** all writes append */
|
|
75
|
+
XFlag[XFlag["Append"] = 16] = "Append";
|
|
76
|
+
/** all writes synchronous */
|
|
77
|
+
XFlag[XFlag["Sync"] = 32] = "Sync";
|
|
78
|
+
/** do not update access time */
|
|
79
|
+
XFlag[XFlag["NoAtime"] = 64] = "NoAtime";
|
|
80
|
+
/** do not include in backups */
|
|
81
|
+
XFlag[XFlag["NoDump"] = 128] = "NoDump";
|
|
82
|
+
/** create with rt bit set */
|
|
83
|
+
XFlag[XFlag["RtInherit"] = 256] = "RtInherit";
|
|
84
|
+
/** create with parents projid */
|
|
85
|
+
XFlag[XFlag["ProjInherit"] = 512] = "ProjInherit";
|
|
86
|
+
/** disallow symlink creation */
|
|
87
|
+
XFlag[XFlag["NoSymlinks"] = 1024] = "NoSymlinks";
|
|
88
|
+
/** extent size allocator hint */
|
|
89
|
+
XFlag[XFlag["ExtSize"] = 2048] = "ExtSize";
|
|
90
|
+
/** inherit inode extent size */
|
|
91
|
+
XFlag[XFlag["ExtSzInherit"] = 4096] = "ExtSzInherit";
|
|
92
|
+
/** do not defragment */
|
|
93
|
+
XFlag[XFlag["NoDefrag"] = 8192] = "NoDefrag";
|
|
94
|
+
/** use filestream allocator */
|
|
95
|
+
XFlag[XFlag["FileStream"] = 16384] = "FileStream";
|
|
96
|
+
/** use DAX for IO */
|
|
97
|
+
XFlag[XFlag["Dax"] = 32768] = "Dax";
|
|
98
|
+
/** CoW extent size allocator hint */
|
|
99
|
+
XFlag[XFlag["CowExtSize"] = 65536] = "CowExtSize";
|
|
100
|
+
/** no DIFLAG for this */
|
|
101
|
+
XFlag[XFlag["HasAttr"] = 2147483648] = "HasAttr";
|
|
102
|
+
})(XFlag || (XFlag = {}));
|
|
103
|
+
let fsxattr = (() => {
|
|
104
|
+
var _fsxattr_xflags_accessor_storage, _fsxattr_extsize_accessor_storage, _fsxattr_nextents_accessor_storage, _fsxattr_projid_accessor_storage, _fsxattr_cowextsize_accessor_storage, _fsxattr_pad_accessor_storage;
|
|
105
|
+
var _a, _b, _c, _d, _e;
|
|
106
|
+
let _classDecorators = [struct()];
|
|
107
|
+
let _classDescriptor;
|
|
108
|
+
let _classExtraInitializers = [];
|
|
109
|
+
let _classThis;
|
|
110
|
+
let _classSuper = BufferView;
|
|
111
|
+
let _xflags_decorators;
|
|
112
|
+
let _xflags_initializers = [];
|
|
113
|
+
let _xflags_extraInitializers = [];
|
|
114
|
+
let _extsize_decorators;
|
|
115
|
+
let _extsize_initializers = [];
|
|
116
|
+
let _extsize_extraInitializers = [];
|
|
117
|
+
let _nextents_decorators;
|
|
118
|
+
let _nextents_initializers = [];
|
|
119
|
+
let _nextents_extraInitializers = [];
|
|
120
|
+
let _projid_decorators;
|
|
121
|
+
let _projid_initializers = [];
|
|
122
|
+
let _projid_extraInitializers = [];
|
|
123
|
+
let _cowextsize_decorators;
|
|
124
|
+
let _cowextsize_initializers = [];
|
|
125
|
+
let _cowextsize_extraInitializers = [];
|
|
126
|
+
let _pad_decorators;
|
|
127
|
+
let _pad_initializers = [];
|
|
128
|
+
let _pad_extraInitializers = [];
|
|
129
|
+
var fsxattr = _classThis = class extends _classSuper {
|
|
130
|
+
/** xflags field value */
|
|
131
|
+
get xflags() { return __classPrivateFieldGet(this, _fsxattr_xflags_accessor_storage, "f"); }
|
|
132
|
+
set xflags(value) { __classPrivateFieldSet(this, _fsxattr_xflags_accessor_storage, value, "f"); }
|
|
133
|
+
/** extsize field value */
|
|
134
|
+
get extsize() { return __classPrivateFieldGet(this, _fsxattr_extsize_accessor_storage, "f"); }
|
|
135
|
+
set extsize(value) { __classPrivateFieldSet(this, _fsxattr_extsize_accessor_storage, value, "f"); }
|
|
136
|
+
/** nextents field value */
|
|
137
|
+
get nextents() { return __classPrivateFieldGet(this, _fsxattr_nextents_accessor_storage, "f"); }
|
|
138
|
+
set nextents(value) { __classPrivateFieldSet(this, _fsxattr_nextents_accessor_storage, value, "f"); }
|
|
139
|
+
/** project identifier */
|
|
140
|
+
get projid() { return __classPrivateFieldGet(this, _fsxattr_projid_accessor_storage, "f"); }
|
|
141
|
+
set projid(value) { __classPrivateFieldSet(this, _fsxattr_projid_accessor_storage, value, "f"); }
|
|
142
|
+
/** CoW extsize field value */
|
|
143
|
+
get cowextsize() { return __classPrivateFieldGet(this, _fsxattr_cowextsize_accessor_storage, "f"); }
|
|
144
|
+
set cowextsize(value) { __classPrivateFieldSet(this, _fsxattr_cowextsize_accessor_storage, value, "f"); }
|
|
145
|
+
get pad() { return __classPrivateFieldGet(this, _fsxattr_pad_accessor_storage, "f"); }
|
|
146
|
+
set pad(value) { __classPrivateFieldSet(this, _fsxattr_pad_accessor_storage, value, "f"); }
|
|
147
|
+
constructor(inode = _throw(new Exception(Errno.EINVAL, 'fsxattr must be initialized with an inode'))) {
|
|
148
|
+
super(new ArrayBuffer(sizeof(fsxattr)));
|
|
149
|
+
_fsxattr_xflags_accessor_storage.set(this, __runInitializers(this, _xflags_initializers, void 0));
|
|
150
|
+
_fsxattr_extsize_accessor_storage.set(this, (__runInitializers(this, _xflags_extraInitializers), __runInitializers(this, _extsize_initializers, void 0)));
|
|
151
|
+
_fsxattr_nextents_accessor_storage.set(this, (__runInitializers(this, _extsize_extraInitializers), __runInitializers(this, _nextents_initializers, void 0)));
|
|
152
|
+
_fsxattr_projid_accessor_storage.set(this, (__runInitializers(this, _nextents_extraInitializers), __runInitializers(this, _projid_initializers, void 0)));
|
|
153
|
+
_fsxattr_cowextsize_accessor_storage.set(this, (__runInitializers(this, _projid_extraInitializers), __runInitializers(this, _cowextsize_initializers, void 0)));
|
|
154
|
+
_fsxattr_pad_accessor_storage.set(this, (__runInitializers(this, _cowextsize_extraInitializers), __runInitializers(this, _pad_initializers, [])));
|
|
155
|
+
__runInitializers(this, _pad_extraInitializers);
|
|
156
|
+
this.extsize = inode.size;
|
|
157
|
+
this.nextents = 1;
|
|
158
|
+
this.projid = inode.uid;
|
|
159
|
+
this.cowextsize = inode.size;
|
|
160
|
+
for (const name of Object.keys(InodeFlags)) {
|
|
161
|
+
if (!(inode.flags & InodeFlags[name]))
|
|
162
|
+
continue;
|
|
163
|
+
if (name in XFlag)
|
|
164
|
+
this.xflags |= XFlag[name];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
_fsxattr_xflags_accessor_storage = new WeakMap();
|
|
169
|
+
_fsxattr_extsize_accessor_storage = new WeakMap();
|
|
170
|
+
_fsxattr_nextents_accessor_storage = new WeakMap();
|
|
171
|
+
_fsxattr_projid_accessor_storage = new WeakMap();
|
|
172
|
+
_fsxattr_cowextsize_accessor_storage = new WeakMap();
|
|
173
|
+
_fsxattr_pad_accessor_storage = new WeakMap();
|
|
174
|
+
__setFunctionName(_classThis, "fsxattr");
|
|
175
|
+
(() => {
|
|
176
|
+
var _a;
|
|
177
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
178
|
+
_xflags_decorators = [(_a = t).uint32.bind(_a)];
|
|
179
|
+
_extsize_decorators = [(_b = t).uint32.bind(_b)];
|
|
180
|
+
_nextents_decorators = [(_c = t).uint32.bind(_c)];
|
|
181
|
+
_projid_decorators = [(_d = t).uint32.bind(_d)];
|
|
182
|
+
_cowextsize_decorators = [(_e = t).uint32.bind(_e)];
|
|
183
|
+
_pad_decorators = [t.char(8)];
|
|
184
|
+
__esDecorate(_classThis, null, _xflags_decorators, { kind: "accessor", name: "xflags", static: false, private: false, access: { has: obj => "xflags" in obj, get: obj => obj.xflags, set: (obj, value) => { obj.xflags = value; } }, metadata: _metadata }, _xflags_initializers, _xflags_extraInitializers);
|
|
185
|
+
__esDecorate(_classThis, null, _extsize_decorators, { kind: "accessor", name: "extsize", static: false, private: false, access: { has: obj => "extsize" in obj, get: obj => obj.extsize, set: (obj, value) => { obj.extsize = value; } }, metadata: _metadata }, _extsize_initializers, _extsize_extraInitializers);
|
|
186
|
+
__esDecorate(_classThis, null, _nextents_decorators, { kind: "accessor", name: "nextents", static: false, private: false, access: { has: obj => "nextents" in obj, get: obj => obj.nextents, set: (obj, value) => { obj.nextents = value; } }, metadata: _metadata }, _nextents_initializers, _nextents_extraInitializers);
|
|
187
|
+
__esDecorate(_classThis, null, _projid_decorators, { kind: "accessor", name: "projid", static: false, private: false, access: { has: obj => "projid" in obj, get: obj => obj.projid, set: (obj, value) => { obj.projid = value; } }, metadata: _metadata }, _projid_initializers, _projid_extraInitializers);
|
|
188
|
+
__esDecorate(_classThis, null, _cowextsize_decorators, { kind: "accessor", name: "cowextsize", static: false, private: false, access: { has: obj => "cowextsize" in obj, get: obj => obj.cowextsize, set: (obj, value) => { obj.cowextsize = value; } }, metadata: _metadata }, _cowextsize_initializers, _cowextsize_extraInitializers);
|
|
189
|
+
__esDecorate(_classThis, null, _pad_decorators, { kind: "accessor", name: "pad", static: false, private: false, access: { has: obj => "pad" in obj, get: obj => obj.pad, set: (obj, value) => { obj.pad = value; } }, metadata: _metadata }, _pad_initializers, _pad_extraInitializers);
|
|
190
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
191
|
+
fsxattr = _classThis = _classDescriptor.value;
|
|
192
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
193
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
194
|
+
})();
|
|
195
|
+
return fsxattr = _classThis;
|
|
196
|
+
})();
|
|
197
|
+
/**
|
|
198
|
+
* Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
|
|
199
|
+
* @see `FS_*_FL` in `include/uapi/linux/fs.h` (around L250)
|
|
200
|
+
* @experimental
|
|
201
|
+
*/
|
|
202
|
+
var FileFlag;
|
|
203
|
+
(function (FileFlag) {
|
|
204
|
+
/** Secure deletion */
|
|
205
|
+
FileFlag[FileFlag["SecureRm"] = 1] = "SecureRm";
|
|
206
|
+
/** Undelete */
|
|
207
|
+
FileFlag[FileFlag["Undelete"] = 2] = "Undelete";
|
|
208
|
+
/** Compress file */
|
|
209
|
+
FileFlag[FileFlag["Compress"] = 4] = "Compress";
|
|
210
|
+
/** Synchronous updates */
|
|
211
|
+
FileFlag[FileFlag["Sync"] = 8] = "Sync";
|
|
212
|
+
/** Immutable file */
|
|
213
|
+
FileFlag[FileFlag["Immutable"] = 16] = "Immutable";
|
|
214
|
+
/** Writes to file may only append */
|
|
215
|
+
FileFlag[FileFlag["Append"] = 32] = "Append";
|
|
216
|
+
/** do not dump file */
|
|
217
|
+
FileFlag[FileFlag["NoDump"] = 64] = "NoDump";
|
|
218
|
+
/** do not update atime */
|
|
219
|
+
FileFlag[FileFlag["NoAtime"] = 128] = "NoAtime";
|
|
220
|
+
// Reserved for compression usage...
|
|
221
|
+
FileFlag[FileFlag["Dirty"] = 256] = "Dirty";
|
|
222
|
+
/** One or more compressed clusters */
|
|
223
|
+
FileFlag[FileFlag["CompressBlk"] = 512] = "CompressBlk";
|
|
224
|
+
/** Don't compress */
|
|
225
|
+
FileFlag[FileFlag["NoCompress"] = 1024] = "NoCompress";
|
|
226
|
+
// End compression flags --- maybe not all used
|
|
227
|
+
/** Encrypted file */
|
|
228
|
+
FileFlag[FileFlag["Encrypt"] = 2048] = "Encrypt";
|
|
229
|
+
/** btree format dir */
|
|
230
|
+
FileFlag[FileFlag["Btree"] = 4096] = "Btree";
|
|
231
|
+
/** hash-indexed directory */
|
|
232
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
233
|
+
FileFlag[FileFlag["Index"] = 4096] = "Index";
|
|
234
|
+
/** AFS directory */
|
|
235
|
+
FileFlag[FileFlag["IMagic"] = 8192] = "IMagic";
|
|
236
|
+
/** Reserved for ext3 */
|
|
237
|
+
FileFlag[FileFlag["JournalData"] = 16384] = "JournalData";
|
|
238
|
+
/** file tail should not be merged */
|
|
239
|
+
FileFlag[FileFlag["NoTail"] = 32768] = "NoTail";
|
|
240
|
+
/** dirsync behaviour (directories only) */
|
|
241
|
+
FileFlag[FileFlag["DirSync"] = 65536] = "DirSync";
|
|
242
|
+
/** Top of directory hierarchies*/
|
|
243
|
+
FileFlag[FileFlag["TopDir"] = 131072] = "TopDir";
|
|
244
|
+
/** Reserved for ext4 */
|
|
245
|
+
FileFlag[FileFlag["HugeFile"] = 262144] = "HugeFile";
|
|
246
|
+
/** Extents */
|
|
247
|
+
FileFlag[FileFlag["Extent"] = 524288] = "Extent";
|
|
248
|
+
/** Verity protected inode */
|
|
249
|
+
FileFlag[FileFlag["Verity"] = 1048576] = "Verity";
|
|
250
|
+
/** Inode used for large EA */
|
|
251
|
+
FileFlag[FileFlag["EaInode"] = 2097152] = "EaInode";
|
|
252
|
+
/** Reserved for ext4 */
|
|
253
|
+
FileFlag[FileFlag["EofBlocks"] = 4194304] = "EofBlocks";
|
|
254
|
+
/** Do not cow file */
|
|
255
|
+
FileFlag[FileFlag["NoCow"] = 8388608] = "NoCow";
|
|
256
|
+
/** Inode is DAX */
|
|
257
|
+
FileFlag[FileFlag["Dax"] = 33554432] = "Dax";
|
|
258
|
+
/** Reserved for ext4 */
|
|
259
|
+
FileFlag[FileFlag["InlineData"] = 268435456] = "InlineData";
|
|
260
|
+
/** Create with parents projid */
|
|
261
|
+
FileFlag[FileFlag["ProjInherit"] = 536870912] = "ProjInherit";
|
|
262
|
+
/** Folder is case insensitive */
|
|
263
|
+
FileFlag[FileFlag["CaseFold"] = 1073741824] = "CaseFold";
|
|
264
|
+
/** reserved for ext2 lib */
|
|
265
|
+
FileFlag[FileFlag["Reserved"] = 2147483648] = "Reserved";
|
|
266
|
+
})(FileFlag || (FileFlag = {}));
|
|
267
|
+
/**
|
|
268
|
+
* `FS_IOC_*` commands for {@link ioctl | `ioctl`}
|
|
269
|
+
* @remarks
|
|
270
|
+
* These are computed from a script since constant values are needed for enum member types
|
|
271
|
+
*/
|
|
272
|
+
export var IOC;
|
|
273
|
+
(function (IOC) {
|
|
274
|
+
IOC[IOC["GetFlags"] = 2148034049] = "GetFlags";
|
|
275
|
+
IOC[IOC["SetFlags"] = 1074292226] = "SetFlags";
|
|
276
|
+
IOC[IOC["GetVersion"] = 2148038145] = "GetVersion";
|
|
277
|
+
IOC[IOC["SetVersion"] = 1074296322] = "SetVersion";
|
|
278
|
+
IOC[IOC["Fiemap"] = 3223348747] = "Fiemap";
|
|
279
|
+
IOC[IOC["GetXattr"] = 2149341215] = "GetXattr";
|
|
280
|
+
IOC[IOC["SetXattr"] = 1075599392] = "SetXattr";
|
|
281
|
+
IOC[IOC["GetLabel"] = 2164298801] = "GetLabel";
|
|
282
|
+
IOC[IOC["SetLabel"] = 1090556978] = "SetLabel";
|
|
283
|
+
IOC[IOC["GetUUID"] = 2148603136] = "GetUUID";
|
|
284
|
+
IOC[IOC["GetSysfsPath"] = 2155943169] = "GetSysfsPath";
|
|
285
|
+
})(IOC || (IOC = {}));
|
|
286
|
+
/**
|
|
287
|
+
* `FS_IOC32_*` commands for {@link ioctl | `ioctl`}
|
|
288
|
+
* @remarks
|
|
289
|
+
* These are computed from a script since constant values are needed for enum member types
|
|
290
|
+
*/
|
|
291
|
+
export var IOC32;
|
|
292
|
+
(function (IOC32) {
|
|
293
|
+
IOC32[IOC32["GetFlags"] = 2147771905] = "GetFlags";
|
|
294
|
+
IOC32[IOC32["SetFlags"] = 1074030082] = "SetFlags";
|
|
295
|
+
IOC32[IOC32["GetVersion"] = 2147776001] = "GetVersion";
|
|
296
|
+
IOC32[IOC32["SetVersion"] = 1074034178] = "SetVersion";
|
|
297
|
+
})(IOC32 || (IOC32 = {}));
|
|
298
|
+
/** Perform an `ioctl` on a file or file system. */
|
|
299
|
+
export async function ioctl(
|
|
300
|
+
/** The path to the file or file system to perform the `ioctl` on */
|
|
301
|
+
path,
|
|
302
|
+
/** The command to perform (uint32) */
|
|
303
|
+
command,
|
|
304
|
+
/** The arguments to pass to the command */
|
|
305
|
+
...args) {
|
|
306
|
+
path = normalizePath(path);
|
|
307
|
+
const { fs, path: resolved } = resolveMount(path, this);
|
|
308
|
+
try {
|
|
309
|
+
const inode = new Inode(await fs.stat(resolved));
|
|
310
|
+
switch (command) {
|
|
311
|
+
case IOC.GetFlags:
|
|
312
|
+
case IOC32.GetFlags:
|
|
313
|
+
return inode.flags;
|
|
314
|
+
case IOC.SetFlags:
|
|
315
|
+
case IOC32.SetFlags:
|
|
316
|
+
inode.flags = args[0];
|
|
317
|
+
await fs.touch(resolved, inode);
|
|
318
|
+
return undefined;
|
|
319
|
+
case IOC.GetVersion:
|
|
320
|
+
case IOC32.GetVersion:
|
|
321
|
+
return inode.version;
|
|
322
|
+
case IOC.SetVersion:
|
|
323
|
+
case IOC32.SetVersion:
|
|
324
|
+
inode.version = args[0];
|
|
325
|
+
await fs.touch(resolved, inode);
|
|
326
|
+
return undefined;
|
|
327
|
+
case IOC.Fiemap:
|
|
328
|
+
break;
|
|
329
|
+
case IOC.GetXattr:
|
|
330
|
+
return new fsxattr(inode);
|
|
331
|
+
case IOC.SetXattr:
|
|
332
|
+
break;
|
|
333
|
+
case IOC.GetLabel:
|
|
334
|
+
return fs.label;
|
|
335
|
+
case IOC.SetLabel:
|
|
336
|
+
fs.label = args[0];
|
|
337
|
+
return undefined;
|
|
338
|
+
case IOC.GetUUID:
|
|
339
|
+
return fs.uuid;
|
|
340
|
+
case IOC.GetSysfsPath:
|
|
341
|
+
/**
|
|
342
|
+
* Returns the path component under /sys/fs/ that refers to this filesystem;
|
|
343
|
+
* also /sys/kernel/debug/ for filesystems with debugfs exports
|
|
344
|
+
* @todo Implement sysfs and have each FS implement the /sys/fs/<name> tree
|
|
345
|
+
*/
|
|
346
|
+
return `/sys/fs/${fs.name}/${fs.uuid}`;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
catch (e) {
|
|
350
|
+
throw setUVMessage(Object.assign(e, { syscall: 'ioctl', path }));
|
|
351
|
+
}
|
|
352
|
+
throw UV('ENOTSUP', 'ioctl', path);
|
|
353
|
+
}
|
|
354
|
+
/** Perform an `ioctl` on a file or file system */
|
|
355
|
+
export function ioctlSync(
|
|
356
|
+
/** The path to the file or file system to perform the `ioctl` on */
|
|
357
|
+
path,
|
|
358
|
+
/** The command to perform (uint32) */
|
|
359
|
+
command,
|
|
360
|
+
/** The arguments to pass to the command */
|
|
361
|
+
...args) {
|
|
362
|
+
path = normalizePath(path);
|
|
363
|
+
const { fs, path: resolved } = resolveMount(path, this);
|
|
364
|
+
try {
|
|
365
|
+
const inode = new Inode(fs.statSync(resolved));
|
|
366
|
+
switch (command) {
|
|
367
|
+
case IOC.GetFlags:
|
|
368
|
+
case IOC32.GetFlags:
|
|
369
|
+
return inode.flags;
|
|
370
|
+
case IOC.SetFlags:
|
|
371
|
+
case IOC32.SetFlags:
|
|
372
|
+
inode.flags = args[0];
|
|
373
|
+
fs.touchSync(resolved, inode);
|
|
374
|
+
return undefined;
|
|
375
|
+
case IOC.GetVersion:
|
|
376
|
+
case IOC32.GetVersion:
|
|
377
|
+
return inode.version;
|
|
378
|
+
case IOC.SetVersion:
|
|
379
|
+
case IOC32.SetVersion:
|
|
380
|
+
inode.version = args[0];
|
|
381
|
+
fs.touchSync(resolved, inode);
|
|
382
|
+
return undefined;
|
|
383
|
+
case IOC.Fiemap:
|
|
384
|
+
break;
|
|
385
|
+
case IOC.GetXattr:
|
|
386
|
+
return new fsxattr(inode);
|
|
387
|
+
case IOC.SetXattr:
|
|
388
|
+
break;
|
|
389
|
+
case IOC.GetLabel:
|
|
390
|
+
return fs.label;
|
|
391
|
+
case IOC.SetLabel:
|
|
392
|
+
fs.label = args[0];
|
|
393
|
+
return undefined;
|
|
394
|
+
case IOC.GetUUID:
|
|
395
|
+
return fs.uuid;
|
|
396
|
+
case IOC.GetSysfsPath:
|
|
397
|
+
/**
|
|
398
|
+
* Returns the path component under /sys/fs/ that refers to this filesystem;
|
|
399
|
+
* also /sys/kernel/debug/ for filesystems with debugfs exports
|
|
400
|
+
* @todo Implement sysfs and have each FS implement the /sys/fs/<name> tree
|
|
401
|
+
*/
|
|
402
|
+
return `/sys/fs/${fs.name}/${fs.uuid}`;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
catch (e) {
|
|
406
|
+
throw setUVMessage(Object.assign(e, { syscall: 'ioctl', path }));
|
|
407
|
+
}
|
|
408
|
+
throw UV('ENOTSUP', 'ioctl', path);
|
|
409
|
+
}
|