diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2014-12-08 14:42:36 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-12-09 09:59:10 +0100 |
commit | eb15ab159f6e807f7925b7bb5fff56c73a1f1b3b (patch) | |
tree | 4615db03f2b038d39e65d6b8060aa8df555d1a8d /fs | |
parent | 42c8b4589a9bd021df7bc6d52dd603dbf99164e5 (diff) | |
download | barebox-eb15ab159f6e807f7925b7bb5fff56c73a1f1b3b.tar.gz barebox-eb15ab159f6e807f7925b7bb5fff56c73a1f1b3b.tar.xz |
fs: efivar: preserve more info in inode
Preserve info needed for easy manipulation of variables.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/efivarfs.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/efivarfs.c b/fs/efivarfs.c index aa66aa8dd9..a36020d2d0 100644 --- a/fs/efivarfs.c +++ b/fs/efivarfs.c @@ -35,7 +35,9 @@ #include <mach/efi-device.h> struct efivarfs_inode { - char *name; + s16 *name; + efi_guid_t vendor; + char *full_name; /* name including vendor namespacing */ struct list_head node; }; @@ -225,7 +227,7 @@ static struct dirent *efivarfs_readdir(struct device_d *dev, DIR *dir) inode = list_entry(edir->current, struct efivarfs_inode, node); - strcpy(dir->d.d_name, inode->name); + strcpy(dir->d.d_name, inode->full_name); edir->current = edir->current->next; @@ -271,8 +273,8 @@ static int efivarfs_probe(struct device_d *dev) efi_status_t efiret; efi_guid_t vendor; s16 name[1024]; + char *name8; unsigned long size; - unsigned char *name8; struct efivarfs_priv *priv; name[0] = 0; @@ -289,9 +291,12 @@ static int efivarfs_probe(struct device_d *dev) break; inode = xzalloc(sizeof(*inode)); - name8 = strdup_wchar_to_char(name); + inode->name = strdup_wchar(name); + + inode->vendor = vendor; - inode->name = asprintf("%s-%pUl", name8, &vendor); + name8 = strdup_wchar_to_char(inode->name); + inode->full_name = asprintf("%s-%pUl", name8, &vendor); free(name8); list_add_tail(&inode->node, &priv->inodes); |