f2fs: fix to show missing bits in FS_IOC_GETFLAGS
This patch fixes to show missing encrypt/inline_data flag in FS_IOC_GETFLAGS like ext4 does. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
3e90db63fc
commit
17f85d0708
1 changed files with 9 additions and 2 deletions
|
@ -1590,8 +1590,15 @@ static int f2fs_ioc_getflags(struct file *filp, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct inode *inode = file_inode(filp);
|
struct inode *inode = file_inode(filp);
|
||||||
struct f2fs_inode_info *fi = F2FS_I(inode);
|
struct f2fs_inode_info *fi = F2FS_I(inode);
|
||||||
unsigned int flags = fi->i_flags &
|
unsigned int flags = fi->i_flags;
|
||||||
(F2FS_FL_USER_VISIBLE | F2FS_PROJINHERIT_FL);
|
|
||||||
|
if (file_is_encrypt(inode))
|
||||||
|
flags |= F2FS_ENCRYPT_FL;
|
||||||
|
if (f2fs_has_inline_data(inode) || f2fs_has_inline_dentry(inode))
|
||||||
|
flags |= F2FS_INLINE_DATA_FL;
|
||||||
|
|
||||||
|
flags &= F2FS_FL_USER_VISIBLE;
|
||||||
|
|
||||||
return put_user(flags, (int __user *)arg);
|
return put_user(flags, (int __user *)arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue