Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75764
b: refs/heads/master
c: af6370e
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jan 25, 2008
1 parent 438f7a8 commit 8a3b867
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 44 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb41d9465cdafee45e0cb30f3b7338646221908e
refs/heads/master: af6370ea9268443351d6e931c702dc8162a1c8a1
43 changes: 0 additions & 43 deletions trunk/fs/ecryptfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,51 +744,8 @@ static ssize_t version_show(struct kobject *kobj,

static struct kobj_attribute version_attr = __ATTR_RO(version);

static struct ecryptfs_version_str_map_elem {
u32 flag;
char *str;
} ecryptfs_version_str_map[] = {
{ECRYPTFS_VERSIONING_PASSPHRASE, "passphrase"},
{ECRYPTFS_VERSIONING_PUBKEY, "pubkey"},
{ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH, "plaintext passthrough"},
{ECRYPTFS_VERSIONING_POLICY, "policy"},
{ECRYPTFS_VERSIONING_XATTR, "metadata in extended attribute"},
{ECRYPTFS_VERSIONING_MULTKEY, "multiple keys per file"}
};

static ssize_t version_str_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff)
{
int i;
int remaining = PAGE_SIZE;
int total_written = 0;

buff[0] = '\0';
for (i = 0; i < ARRAY_SIZE(ecryptfs_version_str_map); i++) {
int entry_size;

if (!(ECRYPTFS_VERSIONING_MASK
& ecryptfs_version_str_map[i].flag))
continue;
entry_size = strlen(ecryptfs_version_str_map[i].str);
if ((entry_size + 2) > remaining)
goto out;
memcpy(buff, ecryptfs_version_str_map[i].str, entry_size);
buff[entry_size++] = '\n';
buff[entry_size] = '\0';
buff += entry_size;
total_written += entry_size;
remaining -= entry_size;
}
out:
return total_written;
}

static struct kobj_attribute version_attr_str = __ATTR_RO(version_str);

static struct attribute *attributes[] = {
&version_attr.attr,
&version_attr_str.attr,
NULL,
};

Expand Down

0 comments on commit 8a3b867

Please sign in to comment.