summaryrefslogtreecommitdiff
path: root/include/uapi/linux/ntfs.h
AgeCommit message (Collapse)Author
32 hoursntfs: avoid unnecessary padding in uapi structureArnd Bergmann
Building the uapi headers with -Wpadded shows a warning that may indicate an incompatibility: ./usr/include/linux/ntfs.h:91:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded] This is relatively harmless here as the 64-bit members force natural alignment, so this is not a problem for compat ioctls, and I checked that the padding word is still initialized by means of using kvzalloc() to allocate it, but it's better to avoid the padding out of principle. Change the reserved member to use a 64-bit type so the name field starts after the structure and all padding is explicit. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Baolin Liu <liubaolin@kylinos.cn> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
32 hoursntfs: add named stream ioctls supportNamjae Jeon
NTFS supports multiple named $DATA attributes, commonly known as alternate data streams. Add NTFS-specific ioctls to list, read, write, and remove named streams through an opened base file or directory. The UAPI provides separate commands for each operation. - NTFS_IOC_STREAM_READ - NTFS_IOC_STREAM_WRITE - NTFS_IOC_STREAM_REMOVE - NTFS_IOC_LIST_STREAMS Read and write requests use struct ntfs_stream to specify the stream name, byte offset, and transfer length. Writes create the stream if it does not already exist. A write failure after creation may leave the new stream visible. It is not rolled back because another caller may already have opened it. Userspace can remove it with NTFS_IOC_STREAM_REMOVE. The list command returns variable-length entries containing each named stream's data size, allocated size, and name. If the buffer is too small, the command returns -ENOSPC without copying entries. bytes_returned reports the required buffer size, and stream_count reports the number of streams. Stream names use the mounted filesystem NLS by default. Set NTFS_STREAM_FL_UTF16 to pass or receive raw UTF-16LE names. In NLS mode, names that cannot be represented by the mounted character set are omitted from the list. Use UTF-16 mode for lossless enumeration. Read and write transfers are limited to 16 MiB per request. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>