aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/cmd/linux_dos_attributes/dos_attributes.h
blob: dd3a820ff20c4bff2d97df27a536b8aa03c01ff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// SPDX-License-Identifier: 0BSD

#include <inttypes.h>


#define	U_APPEND_SHORT		"uappnd"
#define	U_APPEND_FULL		"uappend"
#define	SU_APPEND_SHORT		"sappnd"
#define	SU_APPEND_FULL		"sappend"

#define	U_ARCH_SHORT		"uarch"
#define	U_ARCH_FULL		"uarchive"
#define	SU_ARCH_SHORT		"arch"
#define	SU_ARCH_FULL		"archived"

#define	U_HIDDEN_SHORT		"hidden"
#define	U_HIDDEN_FULL		"uhidden"

#define	SU_IMMUTABLE_FULL	"simmutable"
#define	SU_IMMUTABLE_SHORT	"schange"
#define	SU_IMMUTABLE		"schg"
#define	U_IMMUTABLE_FULL	"uimmutable"
#define	U_IMMUTABLE_SHORT	"uchange"
#define	U_IMMUTABLE		"uchg"

#define	SU_NODUMP		"nodump"
#define	UNSET_NODUMP		"dump"

#define	U_UNLINK_SHORT		"uunlnk"
#define	U_UNLINK_FULL		"uunlink"
#define	SU_UNLINK_SHORT		"sunlnk"
#define	SU_UNLINK_FULL		"sunlink"

#define	U_OFFLINE_SHORT		"offline"
#define	U_OFFLINE_FULL		"uoffline"

#define	U_RDONLY		"rdonly"
#define	U_RDONLY_SHORT		"urdonly"
#define	U_RDONLY_FULL		"readonly"

#define	U_REPARSE_SHORT		"reparse"
#define	U_REPARSE_FULL		"ureparse"

#define	U_SPARSE_SHORT		"sparse"
#define	U_SPARSE_FULL		"usparse"

#define	U_SYSTEM_SHORT		"system"
#define	U_SYSTEM_FULL		"usystem"


static const uint64_t all_dos_attributes[] = {
	ZFS_ARCHIVE,
	ZFS_APPENDONLY,
	ZFS_IMMUTABLE,
	ZFS_NOUNLINK,
	ZFS_NODUMP,
	ZFS_HIDDEN,
	ZFS_OFFLINE,
	ZFS_READONLY,
	ZFS_SPARSE,
	ZFS_SYSTEM,
	ZFS_REPARSE,
};

static const char *const all_dos_attribute_names[][7] = {
	{U_ARCH_SHORT, U_ARCH_FULL, SU_ARCH_SHORT, SU_ARCH_FULL},
	{U_APPEND_SHORT, U_APPEND_FULL, SU_APPEND_SHORT, SU_APPEND_FULL},
	{SU_IMMUTABLE_FULL, SU_IMMUTABLE_SHORT, SU_IMMUTABLE,
	    U_IMMUTABLE_FULL, U_IMMUTABLE_SHORT, U_IMMUTABLE},
	{U_UNLINK_SHORT, U_UNLINK_FULL, SU_UNLINK_FULL, SU_UNLINK_SHORT},
	{SU_NODUMP, /* UNSET_NODUMP */},
	{U_HIDDEN_SHORT, U_HIDDEN_FULL},
	{U_OFFLINE_SHORT, U_OFFLINE_FULL},
	{U_RDONLY, U_RDONLY_SHORT, U_RDONLY_FULL},
	{U_SPARSE_SHORT, U_SPARSE_FULL},
	{U_SYSTEM_SHORT, U_SYSTEM_FULL},
	{U_REPARSE_SHORT, U_REPARSE_FULL},
};

_Static_assert(
    ARRAY_SIZE(all_dos_attributes) == ARRAY_SIZE(all_dos_attribute_names),
	"attribute list length mismatch");