[PATCH i-g-t v4 3/5] lib/igt_fs: Rename igt_io to igt_fs to add additional helpers

Riana Tauro riana.tauro at intel.com
Tue May 20 06:49:08 UTC 2025


Rename igt_io to igt_fs to add additional helper functions
to create and remove directories

v2: add docs (José)
    reorder headers (Kamil)

Cc: Louis Chauvet <louis.chauvet at bootlin.com>
Cc: José Expósito <jose.exposito89 at gmail.com>
Signed-off-by: Riana Tauro <riana.tauro at intel.com>
Reviewed-by: Aravind Iddamsetty <aravind.iddamsetty at linux.intel.com>
Reviewed-by: José Expósito <jose.exposito89 at gmail.com>
---
 docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml |  2 +-
 lib/{igt_io.c => igt_fs.c}                          | 12 ++++++------
 lib/{igt_io.h => igt_fs.h}                          |  6 +++---
 lib/igt_sysfs.c                                     |  2 +-
 lib/meson.build                                     |  2 +-
 tests/msm/msm_mapping.c                             |  2 +-
 tests/msm/msm_recovery.c                            |  2 +-
 7 files changed, 14 insertions(+), 14 deletions(-)
 rename lib/{igt_io.c => igt_fs.c} (93%)
 rename lib/{igt_io.h => igt_fs.h} (94%)

diff --git a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
index 11458c681..4cba804c3 100644
--- a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
+++ b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
@@ -31,9 +31,9 @@
     <xi:include href="xml/igt_dummyload.xml"/>
     <xi:include href="xml/igt_fb.xml"/>
     <xi:include href="xml/igt_frame.xml"/>
+    <xi:include href="xml/igt_fs.xml"/>
     <xi:include href="xml/igt_gt.xml"/>
     <xi:include href="xml/igt_hook.xml"/>
-    <xi:include href="xml/igt_io.xml"/>
     <xi:include href="xml/igt_kmod.xml"/>
     <xi:include href="xml/igt_kms.xml"/>
     <xi:include href="xml/igt_list.xml"/>
diff --git a/lib/igt_io.c b/lib/igt_fs.c
similarity index 93%
rename from lib/igt_io.c
rename to lib/igt_fs.c
index b5143184f..917ee80de 100644
--- a/lib/igt_io.c
+++ b/lib/igt_fs.c
@@ -26,15 +26,15 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#include "igt_io.h"
+#include "igt_fs.h"
 
 /**
- * SECTION:igt_io
- * @short_description: Helpers for file I/O
- * @title: io
- * @include: igt_io.h
+ * SECTION:igt_fs
+ * @short_description: Helpers for file operations
+ * @title: fs
+ * @include: igt_fs.h
  *
- * This library provides helpers for file I/O
+ * This library provides helpers for file operations
  */
 
 /**
diff --git a/lib/igt_io.h b/lib/igt_fs.h
similarity index 94%
rename from lib/igt_io.h
rename to lib/igt_fs.h
index eb9ffee1b..84c3fed62 100644
--- a/lib/igt_io.h
+++ b/lib/igt_fs.h
@@ -22,12 +22,12 @@
  *
  */
 
-#ifndef __IGT_IO_H__
-#define __IGT_IO_H__
+#ifndef __IGT_FS_H__
+#define __IGT_FS_H__
 
 #include <stdio.h>
 
 ssize_t igt_readn(int fd, char *buf, size_t len);
 ssize_t igt_writen(int fd, const char *buf, size_t len);
 
-#endif /* __IGT_IO_H__ */
+#endif /* __IGT_FS_H__ */
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index bc68cf61b..2ba96ca7f 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -46,7 +46,7 @@
 #include "igt_core.h"
 #include "igt_sysfs.h"
 #include "igt_device.h"
-#include "igt_io.h"
+#include "igt_fs.h"
 #include "intel_chipset.h"
 #include "xe/xe_query.h"
 
diff --git a/lib/meson.build b/lib/meson.build
index 4a9213375..6f3a1150c 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,11 +26,11 @@ lib_sources = [
 	'igt_device_scan.c',
 	'igt_drm_clients.h',
 	'igt_drm_fdinfo.c',
+        'igt_fs.c',
 	'igt_aux.c',
 	'igt_gt.c',
 	'igt_halffloat.c',
 	'igt_hwmon.c',
-	'igt_io.c',
 	'igt_matrix.c',
 	'igt_os.c',
 	'igt_params.c',
diff --git a/tests/msm/msm_mapping.c b/tests/msm/msm_mapping.c
index e24618607..ac20ca91d 100644
--- a/tests/msm/msm_mapping.c
+++ b/tests/msm/msm_mapping.c
@@ -28,8 +28,8 @@
 #include <sys/stat.h>
 
 #include "igt.h"
+#include "igt_fs.h"
 #include "igt_msm.h"
-#include "igt_io.h"
 
 /*
  * Tests to ensure various kernel controlled buffers are mapped with the
diff --git a/tests/msm/msm_recovery.c b/tests/msm/msm_recovery.c
index 608836866..fbe26e687 100644
--- a/tests/msm/msm_recovery.c
+++ b/tests/msm/msm_recovery.c
@@ -25,8 +25,8 @@
 #include <glob.h>
 
 #include "igt.h"
+#include "igt_fs.h"
 #include "igt_msm.h"
-#include "igt_io.h"
 
 static struct msm_device *dev;
 static struct msm_bo *scratch_bo;
-- 
2.47.1



More information about the igt-dev mailing list