Re: [PATCH 2/4] relayfs: Documentation for non-relay file support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Morton writes:
 > Tom Zanussi <[email protected]> wrote:
 > >
 > >  +relay_open() automatically creates files in the relayfs filesystem to
 > >  +represent the per-cpu kernel buffers; it's often useful for
 > >  +applications to be able to create their own files in the relayfs
 > >  +filesystem as well e.g. 'control' files used to communicate control
 > >  +information between the kernel and user sides of a relayfs
 > >  +application.
 > 
 > What are the semantics of these control files?  How does an application
 > know that there's something new to be read from them?  select() or poll()
 > or blocking read()?

It's completely up to the client to define whatever file operations it
wants, which are passed in to relayfs_create_file().  The relayfs
example apps, for instance, read from these files whenever they're
notifed via the relay file poll implementation that there's a
sub-buffer ready.  These are basically the same thing as proc or
debugfs files created by passing explicit file operations.

 > 
 > Can userspace write to the control files?   If so, what happens
in-kernel?

Yes, the client can supply a write() file op that does whatever it
wants to.  For the relayfs examples, the write() implementation
updates the count of sub-buffers consumed, for instance.

Tom


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux