diff options
Diffstat (limited to 'Documentation/filesystems/relayfs.txt')
-rw-r--r-- | Documentation/filesystems/relayfs.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/filesystems/relayfs.txt b/Documentation/filesystems/relayfs.txt index 0720a049d0b8..4221b3a52e25 100644 --- a/Documentation/filesystems/relayfs.txt +++ b/Documentation/filesystems/relayfs.txt | |||
@@ -143,6 +143,8 @@ Here's a summary of the API relayfs provides to in-kernel clients: | |||
143 | subbuf_start(buf, subbuf, prev_subbuf, prev_padding) | 143 | subbuf_start(buf, subbuf, prev_subbuf, prev_padding) |
144 | buf_mapped(buf, filp) | 144 | buf_mapped(buf, filp) |
145 | buf_unmapped(buf, filp) | 145 | buf_unmapped(buf, filp) |
146 | create_buf_file(filename, parent, mode, buf) | ||
147 | remove_buf_file(dentry) | ||
146 | 148 | ||
147 | helper functions: | 149 | helper functions: |
148 | 150 | ||
@@ -343,6 +345,31 @@ completely defined by the caller. | |||
343 | See the relay-apps tarball at http://relayfs.sourceforge.net for | 345 | See the relay-apps tarball at http://relayfs.sourceforge.net for |
344 | examples of how these non-relay files are meant to be used. | 346 | examples of how these non-relay files are meant to be used. |
345 | 347 | ||
348 | Creating relay files in other filesystems | ||
349 | ----------------------------------------- | ||
350 | |||
351 | By default of course, relay_open() creates relay files in the relayfs | ||
352 | filesystem. Because relay_file_operations is exported, however, it's | ||
353 | also possible to create and use relay files in other pseudo-filesytems | ||
354 | such as debugfs. | ||
355 | |||
356 | For this purpose, two callback functions are provided, | ||
357 | create_buf_file() and remove_buf_file(). create_buf_file() is called | ||
358 | once for each per-cpu buffer from relay_open() to allow the client to | ||
359 | create a file to be used to represent the corresponding buffer; if | ||
360 | this callback is not defined, the default implementation will create | ||
361 | and return a file in the relayfs filesystem to represent the buffer. | ||
362 | The callback should return the dentry of the file created to represent | ||
363 | the relay buffer. Note that the parent directory passed to | ||
364 | relay_open() (and passed along to the callback), if specified, must | ||
365 | exist in the same filesystem the new relay file is created in. If | ||
366 | create_buf_file() is defined, remove_buf_file() must also be defined; | ||
367 | it's responsible for deleting the file(s) created in create_buf_file() | ||
368 | and is called during relay_close(). | ||
369 | |||
370 | See the 'exported-relayfile' examples in the relay-apps tarball for | ||
371 | examples of creating and using relay files in debugfs. | ||
372 | |||
346 | Misc | 373 | Misc |
347 | ---- | 374 | ---- |
348 | 375 | ||