diff options
author | Eric Biggers <ebiggers@google.com> | 2019-04-24 10:59:09 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-05-20 17:29:50 -0700 |
commit | 04bbe693115af9266d570f1129892ae662653175 (patch) | |
tree | a56fdc819dcd44ab35f3dbd6840788c78182e8f2 /include/f2fs_fs.h | |
parent | b9aca4663929e445f82cfea22d991b925091ad0a (diff) | |
download | f2fs-tools-04bbe693115af9266d570f1129892ae662653175.tar.gz |
f2fs-tools: improve filename printing
- Make buffers for pretty-printed filenames 341 bytes long, long enough
for 255 (NAME_MAX) base64-encoded bytes. Then print encrypted
filenames in full, base64-encoded. This will be useful for tests I'm
writing which verify the correct ciphertext is stored on-disk.
- Rename convert_encrypted_name() to pretty_print_filename(), to make it
clear that it handles unencrypted names too. Also make the output
'char' rather than 'unsigned char', as it's for printing; and remove
the unnecessary return value.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'include/f2fs_fs.h')
-rw-r--r-- | include/f2fs_fs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index b4f992f..f0d2bcf 100644 --- a/include/f2fs_fs.h +++ b/include/f2fs_fs.h @@ -721,6 +721,10 @@ struct f2fs_extent { } __attribute__((packed)); #define F2FS_NAME_LEN 255 + +/* max output length of pretty_print_filename() including null terminator */ +#define F2FS_PRINT_NAMELEN (4 * ((F2FS_NAME_LEN + 2) / 3) + 1) + /* 200 bytes for inline xattrs by default */ #define DEFAULT_INLINE_XATTR_ADDRS 50 #define DEF_ADDRS_PER_INODE 923 /* Address Pointers in an Inode */ |