diff options
author | David Howells <dhowells@redhat.com> | 2017-03-31 13:31:56 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-04-03 01:05:58 -0400 |
commit | 99652ea56a4186bc5bf8a3721c5353f41b35ebcb (patch) | |
tree | e03bdcba50a201bb822821364dd9bd1cd7405600 /fs/ext4/symlink.c | |
parent | 64bd72048a2ac07efed70debe606a1c6e5e03554 (diff) |
ext4: Add statx support
Return enhanced file attributes from the Ext4 filesystem. This includes
the following:
(1) The inode creation time (i_crtime) as stx_btime, setting STATX_BTIME.
(2) Certain FS_xxx_FL flags are mapped to stx_attribute flags.
This requires that all ext4 inodes have a getattr call, not just some of
them, so to this end, split the ext4_getattr() function and only call part
of it where appropriate.
Example output:
[root@andromeda ~]# touch foo
[root@andromeda ~]# chattr +ai foo
[root@andromeda ~]# /tmp/test-statx foo
statx(foo) = 0
results=fff
Size: 0 Blocks: 0 IO Block: 4096 regular file
Device: 08:12 Inode: 2101950 Links: 1
Access: (0644/-rw-r--r--) Uid: 0 Gid: 0
Access: 2016-02-11 17:08:29.031795451+0000
Modify: 2016-02-11 17:08:29.031795451+0000
Change: 2016-02-11 17:11:11.987790114+0000
Birth: 2016-02-11 17:08:29.031795451+0000
Attributes: 0000000000000030 (-------- -------- -------- -------- -------- -------- -------- --ai----)
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext4/symlink.c')
-rw-r--r-- | fs/ext4/symlink.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c index 73b184d161fc..5c8fc53cb0e5 100644 --- a/fs/ext4/symlink.c +++ b/fs/ext4/symlink.c | |||
@@ -85,17 +85,20 @@ errout: | |||
85 | const struct inode_operations ext4_encrypted_symlink_inode_operations = { | 85 | const struct inode_operations ext4_encrypted_symlink_inode_operations = { |
86 | .get_link = ext4_encrypted_get_link, | 86 | .get_link = ext4_encrypted_get_link, |
87 | .setattr = ext4_setattr, | 87 | .setattr = ext4_setattr, |
88 | .getattr = ext4_getattr, | ||
88 | .listxattr = ext4_listxattr, | 89 | .listxattr = ext4_listxattr, |
89 | }; | 90 | }; |
90 | 91 | ||
91 | const struct inode_operations ext4_symlink_inode_operations = { | 92 | const struct inode_operations ext4_symlink_inode_operations = { |
92 | .get_link = page_get_link, | 93 | .get_link = page_get_link, |
93 | .setattr = ext4_setattr, | 94 | .setattr = ext4_setattr, |
95 | .getattr = ext4_getattr, | ||
94 | .listxattr = ext4_listxattr, | 96 | .listxattr = ext4_listxattr, |
95 | }; | 97 | }; |
96 | 98 | ||
97 | const struct inode_operations ext4_fast_symlink_inode_operations = { | 99 | const struct inode_operations ext4_fast_symlink_inode_operations = { |
98 | .get_link = simple_get_link, | 100 | .get_link = simple_get_link, |
99 | .setattr = ext4_setattr, | 101 | .setattr = ext4_setattr, |
102 | .getattr = ext4_getattr, | ||
100 | .listxattr = ext4_listxattr, | 103 | .listxattr = ext4_listxattr, |
101 | }; | 104 | }; |