aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ecryptfs/main.c')
-rw-r--r--fs/ecryptfs/main.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 6ded37b467ff..d984eac9a7f5 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -744,51 +744,8 @@ static ssize_t version_show(struct kobject *kobj,
744 744
745static struct kobj_attribute version_attr = __ATTR_RO(version); 745static struct kobj_attribute version_attr = __ATTR_RO(version);
746 746
747static struct ecryptfs_version_str_map_elem {
748 u32 flag;
749 char *str;
750} ecryptfs_version_str_map[] = {
751 {ECRYPTFS_VERSIONING_PASSPHRASE, "passphrase"},
752 {ECRYPTFS_VERSIONING_PUBKEY, "pubkey"},
753 {ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH, "plaintext passthrough"},
754 {ECRYPTFS_VERSIONING_POLICY, "policy"},
755 {ECRYPTFS_VERSIONING_XATTR, "metadata in extended attribute"},
756 {ECRYPTFS_VERSIONING_MULTKEY, "multiple keys per file"}
757};
758
759static ssize_t version_str_show(struct kobject *kobj,
760 struct kobj_attribute *attr, char *buff)
761{
762 int i;
763 int remaining = PAGE_SIZE;
764 int total_written = 0;
765
766 buff[0] = '\0';
767 for (i = 0; i < ARRAY_SIZE(ecryptfs_version_str_map); i++) {
768 int entry_size;
769
770 if (!(ECRYPTFS_VERSIONING_MASK
771 & ecryptfs_version_str_map[i].flag))
772 continue;
773 entry_size = strlen(ecryptfs_version_str_map[i].str);
774 if ((entry_size + 2) > remaining)
775 goto out;
776 memcpy(buff, ecryptfs_version_str_map[i].str, entry_size);
777 buff[entry_size++] = '\n';
778 buff[entry_size] = '\0';
779 buff += entry_size;
780 total_written += entry_size;
781 remaining -= entry_size;
782 }
783out:
784 return total_written;
785}
786
787static struct kobj_attribute version_attr_str = __ATTR_RO(version_str);
788
789static struct attribute *attributes[] = { 747static struct attribute *attributes[] = {
790 &version_attr.attr, 748 &version_attr.attr,
791 &version_attr_str.attr,
792 NULL, 749 NULL,
793}; 750};
794 751