From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xladz-0003uU-5K for barebox@lists.infradead.org; Tue, 04 Nov 2014 09:43:21 +0000 Received: from dude.hi.4.pengutronix.de ([10.1.0.7] helo=dude.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Xladd-0002Wv-7M for barebox@lists.infradead.org; Tue, 04 Nov 2014 10:42:57 +0100 From: Lucas Stach Date: Tue, 4 Nov 2014 10:42:53 +0100 Message-Id: <1415094176-26435-7-git-send-email-l.stach@pengutronix.de> In-Reply-To: <1415094176-26435-1-git-send-email-l.stach@pengutronix.de> References: <1415094176-26435-1-git-send-email-l.stach@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 07/10] fs: efivar: preserve more info in inode To: barebox@lists.infradead.org Preserve info needed for easy manipulation of variables. Signed-off-by: Lucas Stach --- fs/efivarfs.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/efivarfs.c b/fs/efivarfs.c index aa66aa8dd99d..a36020d2d08e 100644 --- a/fs/efivarfs.c +++ b/fs/efivarfs.c @@ -35,7 +35,9 @@ #include 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); -- 2.1.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox