diff mbox series

[2/2] doc: document new library functions

Message ID 1551428901-30162-2-git-send-email-sumit.garg@linaro.org
State Accepted
Commit 93262b216e8924a42c318095c3e473e7dadab5f8
Headers show
Series [1/2] syscalls/sync_file_range: add partial file sync test-case | expand

Commit Message

Sumit Garg March 1, 2019, 8:28 a.m. UTC
Document following library functions:
1. tst_fill_file()
2. tst_fill_fd()
3. tst_dev_bytes_written()

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
 doc/test-writing-guidelines.txt | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Comments

Cyril Hrubis March 1, 2019, 3:54 p.m. UTC | #1
Hi!
Pushed, thanks.
diff mbox series

Patch

diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
index f2f72c4..a5fe589 100644
--- a/doc/test-writing-guidelines.txt
+++ b/doc/test-writing-guidelines.txt
@@ -1033,6 +1033,16 @@  results in 'umount(2)' failing with 'EBUSY'.
 IMPORTANT: All testcases should use 'tst_umount()' instead of 'umount(2)' to
            umount filesystems.
 
+[source,c]
+-------------------------------------------------------------------------------
+#include "tst_test.h"
+
+unsigned long tst_dev_bytes_written(const char *dev);
+-------------------------------------------------------------------------------
+
+This function reads test block device stat file (/sys/block/<device>/stat) and
+returns the bytes written since the last invocation of this function.
+
 2.2.15 Formatting a device with a filesystem
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -1142,6 +1152,24 @@  Returns non-zero if directory is empty and zero otherwise.
 
 Directory is considered empty if it contains only '.' and '..'.
 
+[source,c]
+-------------------------------------------------------------------------------
+#include "tst_test.h"
+
+int tst_fill_fd(int fd, char pattern, size_t bs, size_t bcount);
+-------------------------------------------------------------------------------
+
+Fill a file with specified pattern using file descriptor.
+
+[source,c]
+-------------------------------------------------------------------------------
+#include "tst_test.h"
+
+int tst_fill_file(const char *path, char pattern, size_t bs, size_t bcount);
+-------------------------------------------------------------------------------
+
+Creates/ovewrites a file with specified pattern using file path.
+
 2.2.18 Getting an unused PID number
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^