From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Artem Bityutskiy <dedekind@infradead.org>
Cc: linux-mtd@lists.infradead.org
Subject: [RFC] ubi: tmp hack for lstat
Date: Sun, 19 Oct 2008 15:21:22 +0200 [thread overview]
Message-ID: <20081019132122.GA20282@www.tglx.de> (raw)
lstat() on /dev/ubi%d_%d returns 0 in the st_size field. This hack
allows to get the correct file size (as long as nobody updates the volume
in the meantime).
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
I have userpsace programs which stat() the file and process the
returned number bytes. The other work around is to copy the file
somewhere and use this file instead of /dev/ubi.
Artem, do you thing it is possible to implement this functionality
properly or would it be reasonable not to use stat() at all on ubi
volumes?
drivers/mtd/ubi/cdev.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 03c759b..921dd81 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -123,6 +123,7 @@ static int vol_cdev_open(struct inode *inode, struct file *file)
if (IS_ERR(desc))
return PTR_ERR(desc);
+ i_size_write(inode, desc->vol->used_bytes);
file->private_data = desc;
return 0;
}
--
1.5.6.5
next reply other threads:[~2008-10-19 13:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-19 13:21 Sebastian Andrzej Siewior [this message]
2008-10-20 5:13 ` [RFC] ubi: tmp hack for lstat Artem Bityutskiy
2008-10-20 9:11 ` Sebastian Andrzej Siewior
2008-10-20 9:21 ` Artem Bityutskiy
2008-10-20 12:57 ` Peter Korsgaard
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=20081019132122.GA20282@www.tglx.de \
--to=bigeasy@linutronix.de \
--cc=dedekind@infradead.org \
--cc=linux-mtd@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