- Subject: [PATCH 6/6] xstat: eCryptFS: Return extended attributes
- From: David Howells <dhowells@xxxxxxxxxx>
- Date: Thu, 19 Apr 2012 15:07:19 +0100
- Cc: dhowells@xxxxxxxxxx, linux-nfs@xxxxxxxxxxxxxxx, linux-cifs@xxxxxxxxxxxxxxx, samba-technical@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, wine-devel@xxxxxxxxxx, kfm-devel@xxxxxxx, nautilus-list@xxxxxxxxx, linux-api@xxxxxxxxxxxxxxx, libc-alpha@xxxxxxxxxxxxxx
- In-reply-to: <20120419140558.17272.74360.stgit@warthog.procyon.org.uk>
- Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903
- References: <20120419140558.17272.74360.stgit@warthog.procyon.org.uk>
- User-agent: StGIT/0.14.3
Return extended attributes from the eCryptFS filesystem, dredged up from the
lower filesystem. XSTAT_INFO_ENCRYPTED is set on the files whose cryptography
is handled by eCryptFS.
Possibly eCryptFS should also set FS_COMPR_FL on its compressed files.
Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
---
fs/ecryptfs/inode.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index ab35b11..62865e9 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -1060,13 +1060,23 @@ int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat lower_stat;
int rc;
- rc = vfs_getattr(ecryptfs_dentry_to_lower_mnt(dentry),
- ecryptfs_dentry_to_lower(dentry), &lower_stat);
+ lower_stat.query_flags = stat->query_flags;
+ lower_stat.request_mask = stat->request_mask | XSTAT_BLOCKS;
+ rc = vfs_xgetattr(ecryptfs_dentry_to_lower_mnt(dentry),
+ ecryptfs_dentry_to_lower(dentry), &lower_stat);
if (!rc) {
fsstack_copy_attr_all(dentry->d_inode,
ecryptfs_inode_to_lower(dentry->d_inode));
generic_fillattr(dentry->d_inode, stat);
stat->blocks = lower_stat.blocks;
+ stat->result_mask = lower_stat.result_mask;
+ stat->information = lower_stat.information;
+ stat->information |= XSTAT_INFO_ENCRYPTED;
+ stat->gen = lower_stat.gen;
+ stat->version = lower_stat.version;
+ stat->ioc_flags = lower_stat.ioc_flags;
+ memcpy(&stat->volume_id, lower_stat.volume_id,
+ sizeof(stat->volume_id));
}
return rc;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Home]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]