From: Philippe Gerum <rpm@xenomai.org>
To: Kim De Mey <kim.demey@gmail.com>, xenomai@xenomai.org
Subject: Re: [Xenomai] [PATCH 0 of 3] Xenomai-forge: Initial implementation of registry for pSOS
Date: Sat, 19 Oct 2013 19:37:21 +0200 [thread overview]
Message-ID: <5262C351.8010704@xenomai.org> (raw)
In-Reply-To: <patchbomb.1381827036@devws164.be.alcatel-lucent.com>
On 10/15/2013 10:50 AM, Kim De Mey wrote:
> This patch set adds an initial implementation of registry for pSOS
> tasks, semaphores and queues. It is similar as the already existing
> vxworks implementation but with more output data.
>
> Important to mention is that the "size" parameter in the read function
> is not used (it is also not used in the vxworks implementation).
> This will be an issue if the data to output is larger than the buffer
> used. This is now possible to happen as I added messages in the queue
> read function and timers in the task read function. In that case an
> implementation which uses size & offset is necessary.
>
> I am busy implementing a second patch that does this.
> It creates a local buffer which is filled with the data on an "open"
> call. A pointer to the local buffer is saved in the fuse_file_info->fh
> field (requires FUSE version >= 2.5). A read will then just read from
> the local buffer with offset and size given. A release is also needed to
> free the buffer.
>
> However while I continue with this I would like to know whether you see
> this as the right way to go.
IIUC, this would add the quite unexpected requirement of having to
reopen a file for getting fresh data. read() should actually (re-)read
the current object state each time it is invoked, and not resend some
frozen state collected by the corresponding open() indefinitely.
e.g. this has to work with code like:
fd = open("/mnt/xenomai/1235/foo/tasks", O_RDONLY);
for (;;) {
ret = read(fd, buf, sizeof(buf));
... process NEW data ...
}
As I mentioned earlier, referring to fuse_file_info->fh from a registry
client is not acceptable. Exposing this fs-private information to the
clients directly (e.g. psos emulator) would prevent any further use by
copperplate/registry although it's actually the fs implementation layer
(not psos). So the day we'd need to store private data for the registry
fs, we could not use fh, although this is what we should definitely be
using in this case.
If you really need to provide for holding private data in a fuse _file_
object, instead of a copperplate _filesystem_ object (i.e. struct
fsobj), then the fuse file object should be abstracted first in
copperplate/registry (e.g. struct fileobj), then passed as an additional
parameter to all client callbacks. That file (descriptor) object could
then hold a client-specific private data pointer. In short, this change
should be introduced in the generic registry layer, not in the psos
emulator.
The question being: do you really need this?
--
Philippe.
next prev parent reply other threads:[~2013-10-19 17:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 8:50 [Xenomai] [PATCH 0 of 3] Xenomai-forge: Initial implementation of registry for pSOS Kim De Mey
2013-10-15 8:50 ` [Xenomai] [PATCH 1 of 3] Initial implementation registry pSOS task Kim De Mey
2013-10-15 8:50 ` [Xenomai] [PATCH 2 of 3] Initial implementation registry pSOS semaphore Kim De Mey
2013-10-22 16:54 ` Kim De Mey
2013-10-15 8:50 ` [Xenomai] [PATCH 3 of 3] Initial implementation registry pSOS queue Kim De Mey
2013-10-19 17:37 ` Philippe Gerum [this message]
2013-10-19 18:56 ` [Xenomai] [PATCH 0 of 3] Xenomai-forge: Initial implementation of registry for pSOS Ronny Meeus
2013-10-22 16:45 ` Kim De Mey
2013-10-22 17:06 ` Philippe Gerum
2013-10-22 18:18 ` Kim De Mey
2013-10-24 8:28 ` Kim De Mey
2013-10-24 9:00 ` Philippe Gerum
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=5262C351.8010704@xenomai.org \
--to=rpm@xenomai.org \
--cc=kim.demey@gmail.com \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.