• Daeho Jeong's avatar
    f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl · 9af84648
    Daeho Jeong authored
    Added a new ioctl to send discard commands or/and zero out
    to selected data area of a regular file for security reason.
    
    The way of handling range.len of F2FS_IOC_SEC_TRIM_FILE:
    1. Added -1 value support for range.len to secure trim the whole blocks
       starting from range.start regardless of i_size.
    2. If the end of the range passes over the end of file, it means until
       the end of file (i_size).
    3. ignored the case of that range.len is zero to prevent the function
       from making end_addr zero and triggering different behaviour of
       the function.
    Signed-off-by: default avatarDaeho Jeong <daehojeong@google.com>
    Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    9af84648
f2fs.h 131 KB