diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2021-10-05 19:08:08 +0300 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2021-10-11 19:28:06 +0300 |
commit | cd4c76ff807c1afeed89f1b7e311760c0e296349 (patch) | |
tree | b31ebb58def6ac01546536dff40d60d90f0261c8 /fs/ntfs3/frecord.c | |
parent | 14a981193e409d8ca3f89768cfbd7a9a516d9927 (diff) | |
download | linux-cd4c76ff807c1afeed89f1b7e311760c0e296349.tar.gz linux-cd4c76ff807c1afeed89f1b7e311760c0e296349.tar.bz2 linux-cd4c76ff807c1afeed89f1b7e311760c0e296349.zip |
fs/ntfs3: Refactor ni_parse_reparse
Change argument from void* to struct REPARSE_DATA_BUFFER*
We copy data to buffer, so we can read it later in ntfs_read_mft.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/frecord.c')
-rw-r--r-- | fs/ntfs3/frecord.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index 007602badd90..ecb965e4afd0 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -1710,18 +1710,16 @@ out: /* * ni_parse_reparse * - * Buffer is at least 24 bytes. + * buffer - memory for reparse buffer header */ enum REPARSE_SIGN ni_parse_reparse(struct ntfs_inode *ni, struct ATTRIB *attr, - void *buffer) + struct REPARSE_DATA_BUFFER *buffer) { const struct REPARSE_DATA_BUFFER *rp = NULL; u8 bits; u16 len; typeof(rp->CompressReparseBuffer) *cmpr; - static_assert(sizeof(struct REPARSE_DATA_BUFFER) <= 24); - /* Try to estimate reparse point. */ if (!attr->non_res) { rp = resident_data_ex(attr, sizeof(struct REPARSE_DATA_BUFFER)); @@ -1807,6 +1805,9 @@ enum REPARSE_SIGN ni_parse_reparse(struct ntfs_inode *ni, struct ATTRIB *attr, return REPARSE_NONE; } + if (buffer != rp) + memcpy(buffer, rp, sizeof(struct REPARSE_DATA_BUFFER)); + /* Looks like normal symlink. */ return REPARSE_LINK; } |