aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2017-05-20 18:16:26 -0400
committerRichard Weinberger <richard@nod.at>2017-07-14 16:49:07 -0400
commita02a6eba9999221b27c691330e93bb54e4b45bb0 (patch)
tree29aa4dffa33c6071dc48be3c36e540bee0db24ee
parentd2eb85226fcd981767d1829b09ae1070cf695b98 (diff)
ubifs: Wire-up statx() support
statx() can report what flags a file has, expose flags that UBIFS supports. Especially STATX_ATTR_COMPRESSED and STATX_ATTR_ENCRYPTED can be interesting for userspace. Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--fs/ubifs/dir.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index 90a3f01c55d1..417fe0b29f23 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -1644,6 +1644,21 @@ int ubifs_getattr(const struct path *path, struct kstat *stat,
1644 struct ubifs_inode *ui = ubifs_inode(inode); 1644 struct ubifs_inode *ui = ubifs_inode(inode);
1645 1645
1646 mutex_lock(&ui->ui_mutex); 1646 mutex_lock(&ui->ui_mutex);
1647
1648 if (ui->flags & UBIFS_APPEND_FL)
1649 stat->attributes |= STATX_ATTR_APPEND;
1650 if (ui->flags & UBIFS_COMPR_FL)
1651 stat->attributes |= STATX_ATTR_COMPRESSED;
1652 if (ui->flags & UBIFS_CRYPT_FL)
1653 stat->attributes |= STATX_ATTR_ENCRYPTED;
1654 if (ui->flags & UBIFS_IMMUTABLE_FL)
1655 stat->attributes |= STATX_ATTR_IMMUTABLE;
1656
1657 stat->attributes_mask |= (STATX_ATTR_APPEND |
1658 STATX_ATTR_COMPRESSED |
1659 STATX_ATTR_ENCRYPTED |
1660 STATX_ATTR_IMMUTABLE);
1661
1647 generic_fillattr(inode, stat); 1662 generic_fillattr(inode, stat);
1648 stat->blksize = UBIFS_BLOCK_SIZE; 1663 stat->blksize = UBIFS_BLOCK_SIZE;
1649 stat->size = ui->ui_size; 1664 stat->size = ui->ui_size;