From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 08/10] fs: efivar: don't store attributes in file
Date: Tue, 4 Nov 2014 10:42:54 +0100 [thread overview]
Message-ID: <1415094176-26435-8-git-send-email-l.stach@pengutronix.de> (raw)
In-Reply-To: <1415094176-26435-1-git-send-email-l.stach@pengutronix.de>
We don't have a use-case yet where we need to manipulate
the attributes of a variable and it confuses "normal"
users of the variables.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
fs/efivarfs.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/fs/efivarfs.c b/fs/efivarfs.c
index a36020d2d08e..f54925133848 100644
--- a/fs/efivarfs.c
+++ b/fs/efivarfs.c
@@ -131,6 +131,7 @@ struct efivars_file {
unsigned long size;
efi_guid_t vendor;
s16 *name;
+ u32 attributes;
};
static int efivarfs_open(struct device_d *dev, FILE *f, const char *filename)
@@ -138,7 +139,6 @@ static int efivarfs_open(struct device_d *dev, FILE *f, const char *filename)
struct efivars_file *efile;
efi_status_t efiret;
int ret;
- uint32_t attributes;
efile = xzalloc(sizeof(*efile));
@@ -146,28 +146,27 @@ static int efivarfs_open(struct device_d *dev, FILE *f, const char *filename)
if (ret)
return -ENOENT;
- efiret = RT->get_variable(efile->name, &efile->vendor, &attributes, &efile->size, NULL);
+ efiret = RT->get_variable(efile->name, &efile->vendor,
+ &efile->attributes, &efile->size, NULL);
if (EFI_ERROR(efiret) && efiret != EFI_BUFFER_TOO_SMALL) {
ret = -efi_errno(efiret);
goto out;
}
- efile->buf = malloc(efile->size + sizeof(uint32_t));
+ efile->buf = malloc(efile->size);
if (!efile->buf) {
ret = -ENOMEM;
goto out;
}
efiret = RT->get_variable(efile->name, &efile->vendor, NULL, &efile->size,
- efile->buf + sizeof(uint32_t));
+ efile->buf);
if (EFI_ERROR(efiret)) {
ret = -efi_errno(efiret);
goto out;
}
- *(uint32_t *)efile->buf = attributes;
-
- f->size = efile->size + sizeof(uint32_t);
+ f->size = efile->size;
f->inode = efile;
return 0;
--
2.1.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-11-04 9:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-04 9:42 [PATCH 01/10] efi: add proper reset hook Lucas Stach
2014-11-04 9:42 ` [PATCH 02/10] efi: add Barebox GUID Lucas Stach
2014-11-05 7:21 ` Sascha Hauer
2014-11-05 9:03 ` Lucas Stach
2014-11-04 9:42 ` [PATCH 03/10] fs: efivar: cosmetic changes Lucas Stach
2014-11-04 9:42 ` [PATCH 04/10] fs: efivar: switch to standard list implementation Lucas Stach
2014-11-04 9:42 ` [PATCH 05/10] fs: efivar: move variable discovery into probe Lucas Stach
2014-11-04 9:42 ` [PATCH 06/10] lib: add wchar strdup Lucas Stach
2014-11-04 9:42 ` [PATCH 07/10] fs: efivar: preserve more info in inode Lucas Stach
2014-11-04 9:42 ` Lucas Stach [this message]
2014-11-04 9:42 ` [PATCH 09/10] fs: efivar: implement write support Lucas Stach
2014-11-04 9:42 ` [PATCH 10/10] efi: mount efivarfs by default if enabled Lucas Stach
2014-11-05 7:21 ` [PATCH 01/10] efi: add proper reset hook Sascha Hauer
2014-11-05 9:00 ` Lucas Stach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415094176-26435-8-git-send-email-l.stach@pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox