diff options
| author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2026-07-30 10:47:44 +0200 |
|---|---|---|
| committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2026-07-30 10:50:00 +0200 |
| commit | be310476e8868ebe7a2ce8fb0e7b229535723963 (patch) | |
| tree | f51b4655c92e850a1a08c3b00e09cc64783100ad /tools/perf/scripts/python/stackcollapse.py | |
| parent | 539eb2a86922b7e2b2dee0eac2f73eacce4e8c75 (diff) | |
fs/ntfs3: Add basic support for alternative data streams
An ADS (alternative data stream) is a named $DATA (0x80) attribute.
Until now ntfs3 ignored named data attributes entirely, so the only
stream reachable from userspace was the unnamed one.
Introduce a colon-delimited name syntax so streams can be reached
through the regular VFS interfaces. ntfs_nls_to_utf16() now splits a
lookup name at ':' and stores the stream part in cpu_str::ads_len (the
previously unused padding byte). ntfs_iget5_flags() first instantiates
the base inode, then allocates a second inode whose ->base points at it
and whose ->file.ads holds the stream name. ntfs_test_inode() compares
the stream name as well as the MFT reference, so base and streams get
distinct inodes for the same record.
Because the MFT record belongs to the base inode, the many helpers in
frecord.c and attrlist.c that operate on the record redirect to
ni->base, and ni_lock() and friends take the base inode's mutex. The
attrib.c paths that used to hardcode an unnamed $DATA lookup now pass
ni->file.ads.{name,len}. ni_write_inode() and ni_write_parents() are
no-ops for stream inodes, and ntfs_setattr() drops ATTR_SIZE for them.
Usage, for a file with streams 'ads1' and 'ads2':
cat file:query_streams - list stream names, one per line
cat file:ads1 - read a stream
touch file:ads3 - create a stream on an existing file
rm file:ads1 - remove a stream
The pseudo-stream 'query_streams' is handled in ntfs_file_read_iter()
via ni_query_ads(), which enumerates named $DATA attributes and returns
their names separated by '\n'.
The feature is controlled by the new 'ads' mount option, enabled by
default; mount with 'ads=0' to restore the previous behaviour.
Not implemented yet:
- creating a file and a stream in a single call
- renaming (moving) a stream
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
