aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/main.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-11-02 16:20:40 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:18 -0500
commitaf6370ea9268443351d6e931c702dc8162a1c8a1 (patch)
treef336ac63a43e62a8e5afa1329f4058702c7b2275 /fs/ecryptfs/main.c
parenteb41d9465cdafee45e0cb30f3b7338646221908e (diff)
ecryptfs: remove version_str file from sysfs
This file violates the one-value-per-file sysfs rule. If you all want it added back, please do something like a per-feature file to show what is present and what isn't. Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Mike Halcrow <mhalcrow@us.ibm.com> Cc: Phillip Hellewell <phillip@hellewell.homeip.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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