-
Notifications
You must be signed in to change notification settings - Fork 55.5k
Files
/
Copy pathfs.h
566 lines (511 loc) · 21.9 KB
1
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3
4
5
#ifndef _UAPI_LINUX_FS_H
#define _UAPI_LINUX_FS_H
/*
6
7
8
9
10
* This file has definitions for some important file table structures
* and constants and structures used by various generic file system
* ioctl's. Please do not make any changes in this file before
* sending patches for review to linux-fsdevel@vger.kernel.org and
* linux-api@vger.kernel.org.
11
12
13
14
15
*/
#include <linux/limits.h>
#include <linux/ioctl.h>
#include <linux/types.h>
16
17
18
#ifndef __KERNEL__
#include <linux/fscrypt.h>
#endif
19
20
21
22
23
24
/* Use of MS_* flags within the kernel is restricted to core mount(2) code. */
#if !defined(__KERNEL__)
#include <linux/mount.h>
#endif
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
* the file limit at runtime and only root can increase the per-process
* nr_file rlimit, so it's safe to set up a ridiculously high absolute
* upper limit on files-per-process.
*
* Some programs (notably those using select()) may have to be
* recompiled to take full advantage of the new limits..
*/
/* Fixed constants first: */
#undef NR_OPEN
#define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */
#define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */
#define BLOCK_SIZE_BITS 10
#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
43
44
45
46
47
48
49
50
51
/* flags for integrity meta */
#define IO_INTEGRITY_CHK_GUARD (1U << 0) /* enforce guard check */
#define IO_INTEGRITY_CHK_REFTAG (1U << 1) /* enforce ref check */
#define IO_INTEGRITY_CHK_APPTAG (1U << 2) /* enforce app check */
#define IO_INTEGRITY_VALID_FLAGS (IO_INTEGRITY_CHK_GUARD | \
IO_INTEGRITY_CHK_REFTAG | \
IO_INTEGRITY_CHK_APPTAG)
52
53
54
55
56
57
58
#define SEEK_SET 0 /* seek relative to beginning of file */
#define SEEK_CUR 1 /* seek relative to current file position */
#define SEEK_END 2 /* seek relative to end of file */
#define SEEK_DATA 3 /* seek to the next data */
#define SEEK_HOLE 4 /* seek to the next hole */
#define SEEK_MAX SEEK_HOLE
59
#define RENAME_NOREPLACE (1 << 0) /* Don't overwrite target */
60
#define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */
61
#define RENAME_WHITEOUT (1 << 2) /* Whiteout source */
62
63
64
65
66
67
68
69
struct file_clone_range {
__s64 src_fd;
__u64 src_offset;
__u64 src_length;
__u64 dest_offset;
};
70
71
72
73
74
75
struct fstrim_range {
__u64 start;
__u64 len;
__u64 minlen;
};
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
* We include a length field because some filesystems (vfat) have an identifier
* that we do want to expose as a UUID, but doesn't have the standard length.
*
* We use a fixed size buffer beacuse this interface will, by fiat, never
* support "UUIDs" longer than 16 bytes; we don't want to force all downstream
* users to have to deal with that.
*/
struct fsuuid2 {
__u8 len;
__u8 uuid[16];
};
89
90
91
92
93
struct fs_sysfs_path {
__u8 len;
__u8 name[128];
};
94
95
96
97
98
99
100
101
/* extent-same (dedupe) ioctls; these MUST match the btrfs ioctl definitions */
#define FILE_DEDUPE_RANGE_SAME 0
#define FILE_DEDUPE_RANGE_DIFFERS 1
/* from struct btrfs_ioctl_file_extent_same_info */
struct file_dedupe_range_info {
__s64 dest_fd; /* in - destination file */
__u64 dest_offset; /* in - start of extent in destination */