History

vfs: syscall: Add fsmount() to create a mount for a superblock

Provide a system call by which a filesystem opened with fsopen() and configured by a series of fsconfig() calls can have a detached mount object created for it. This mount object can then be attached to the VFS mount hierarchy using move_mount() by passing the returned file descriptor as the from directory fd. The system call looks like: int mfd = fsmount(int fsfd, unsigned int flags, unsigned int attr_flags); where fsfd is the file descriptor returned by fsopen(). flags can be 0 or FSMOUNT_CLOEXEC. attr_flags is a bitwise-OR of the following flags: MOUNT_ATTR_RDONLY Mount read-only MOUNT_ATTR_NOSUID Ignore suid and sgid bits MOUNT_ATTR_NODEV Disallow access to device special files MOUNT_ATTR_NOEXEC Disallow program execution MOUNT_ATTR__ATIME Setting on how atime should be updated MOUNT_ATTR_RELATIME - Update atime relative to mtime/ctime MOUNT_ATTR_NOATIME - Do not update access times MOUNT_ATTR_STRICTATIME - Always perform atime updates MOUNT_ATTR_NODIRATIME Do not update directory access times In the event that fsmount() fails, it may be possible to get an error message by calling read() on fsfd. If no message is available, ENODATA will be reported.

David Howells committed 8 years ago

Commit 93766fb1 parent ecdab155 files · +165 −4Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/mount.h+18−0
@@ -91,4 +91,22 @@ enum fsconfig_command { · 90 unmodified lines
91 FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */91 FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */
92};92};
93 93
94/*
95 * fsmount() flags.
96 */
97#define FSMOUNT_CLOEXEC 0x00000001
98
99/*
100 * Mount attributes.
101 */
102#define MOUNT_ATTR_RDONLY 0x00000001 /* Mount read-only */
103#define MOUNT_ATTR_NOSUID 0x00000002 /* Ignore suid and sgid bits */
104#define MOUNT_ATTR_NODEV 0x00000004 /* Disallow access to device special files */
105#define MOUNT_ATTR_NOEXEC 0x00000008 /* Disallow program execution */
106#define MOUNT_ATTR__ATIME 0x00000070 /* Setting on how atime should be updated */
107#define MOUNT_ATTR_RELATIME 0x00000000 /* - Update atime relative to mtime/ctime. */
108#define MOUNT_ATTR_NOATIME 0x00000010 /* - Do not update access times. */
109#define MOUNT_ATTR_STRICTATIME 0x00000020 /* - Always perform atime updates */
110#define MOUNT_ATTR_NODIRATIME 0x00000080 /* Do not update directory access times */
111
94#endif /* _UAPI_LINUX_MOUNT_H */112#endif /* _UAPI_LINUX_MOUNT_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t