Skip to content

Commit 4f388c2

Browse files
committed
Document filter functions
Add documentation for the various filter functions. Signed-off-by: Hannes Reinecke <[email protected]>
1 parent e38f649 commit 4f388c2

2 files changed

Lines changed: 39 additions & 39 deletions

File tree

src/nvme/filters.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ int nvme_scan_subsystems(struct dirent ***subsys)
9393
alphasort);
9494
}
9595

96-
int nvme_scan_subsystem_namespaces(nvme_subsystem_t s, struct dirent ***namespaces)
96+
int nvme_scan_subsystem_namespaces(nvme_subsystem_t s, struct dirent ***ns)
9797
{
98-
return scandir(nvme_subsystem_get_sysfs_dir(s), namespaces,
98+
return scandir(nvme_subsystem_get_sysfs_dir(s), ns,
9999
nvme_namespace_filter, alphasort);
100100
}
101101

@@ -105,14 +105,14 @@ int nvme_scan_ctrls(struct dirent ***ctrls)
105105
alphasort);
106106
}
107107

108-
int nvme_scan_ctrl_namespace_paths(nvme_ctrl_t c, struct dirent ***namespaces)
108+
int nvme_scan_ctrl_namespace_paths(nvme_ctrl_t c, struct dirent ***paths)
109109
{
110-
return scandir(nvme_ctrl_get_sysfs_dir(c), namespaces,
110+
return scandir(nvme_ctrl_get_sysfs_dir(c), paths,
111111
nvme_paths_filter, alphasort);
112112
}
113113

114-
int nvme_scan_ctrl_namespaces(nvme_ctrl_t c, struct dirent ***namespaces)
114+
int nvme_scan_ctrl_namespaces(nvme_ctrl_t c, struct dirent ***ns)
115115
{
116-
return scandir(nvme_ctrl_get_sysfs_dir(c), namespaces,
116+
return scandir(nvme_ctrl_get_sysfs_dir(c), ns,
117117
nvme_namespace_filter, alphasort);
118118
}

src/nvme/filters.h

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,78 +19,78 @@
1919
*/
2020

2121
/**
22-
* nvme_namespace_filter() -
23-
* @d:
22+
* nvme_namespace_filter() - Filter for namespaces
23+
* @d: dirent to check
2424
*
25-
* Return:
25+
* Return: 1 if @d matches, 0 otherwise
2626
*/
2727
int nvme_namespace_filter(const struct dirent *d);
2828

2929
/**
30-
* nvme_paths_filter() -
31-
* @d:
30+
* nvme_paths_filter() - Filter for paths
31+
* @d: dirent to check
3232
*
33-
* Return:
33+
* Return: 1 if @d matches, 0 otherwise
3434
*/
3535
int nvme_paths_filter(const struct dirent *d);
3636

3737
/**
38-
* nvme_ctrls_filter() -
39-
* @d:
38+
* nvme_ctrls_filter() - Filter for controllers
39+
* @d: dirent to check
4040
*
41-
* Return:
41+
* Return: 1 if @d matches, 0 otherwise
4242
*/
4343
int nvme_ctrls_filter(const struct dirent *d);
4444

4545
/**
46-
* nvme_subsys_filter() -
47-
* @d:
46+
* nvme_subsys_filter() - Filter for subsystems
47+
* @d: dirent to check
4848
*
49-
* Return:
49+
* Return: 1 if @d matches, 0 otherwise
5050
*/
5151
int nvme_subsys_filter(const struct dirent *d);
5252

5353
/**
54-
* nvme_scan_subsystems() -
55-
* @subsys:
54+
* nvme_scan_subsystems() - Scan for subsystems
55+
* @subsys: Pointer to array of dirents
5656
*
57-
* Return:
57+
* Return: number of entries in @subsys
5858
*/
5959
int nvme_scan_subsystems(struct dirent ***subsys);
6060

6161
/**
62-
* nvme_scan_subsystem_namespaces() -
63-
* @s:
64-
* @namespaces:
62+
* nvme_scan_subsystem_namespaces() - Scan for namespaces in a subsystem
63+
* @s: Subsystem to scan
64+
* @n: Pointer to array of dirents
6565
*
66-
* Return:
66+
* Return: number of entries in @ns
6767
*/
68-
int nvme_scan_subsystem_namespaces(nvme_subsystem_t s, struct dirent ***namespaces);
68+
int nvme_scan_subsystem_namespaces(nvme_subsystem_t s, struct dirent ***ns);
6969

7070
/**
71-
* nvme_scan_ctrls() -
72-
* @ctrls:
71+
* nvme_scan_ctrls() - Scan for controllers
72+
* @ctrls: Pointer to array of dirents
7373
*
74-
* Return:
74+
* Return: number of entries in @ctrls
7575
*/
7676
int nvme_scan_ctrls(struct dirent ***ctrls);
7777

7878
/**
79-
* nvme_scan_ctrl_namespace_paths() -
80-
* @c:
81-
* @namespaces:
79+
* nvme_scan_ctrl_namespace_paths() - Scan for namespace paths in a controller
80+
* @c: Controller to scan
81+
* @paths: Pointer to array of dirents
8282
*
83-
* Return:
83+
* Return: number of entries in @paths
8484
*/
85-
int nvme_scan_ctrl_namespace_paths(nvme_ctrl_t c, struct dirent ***namespaces);
85+
int nvme_scan_ctrl_namespace_paths(nvme_ctrl_t c, struct dirent ***paths);
8686

8787
/**
88-
* nvme_scan_ctrl_namespaces() -
89-
* @c:
90-
* @namespaces:
88+
* nvme_scan_ctrl_namespaces() - Scan for namespaces in a controller
89+
* @c: Controller to scan
90+
* @ns: Pointer to array of dirents
9191
*
92-
* Return:
92+
* Return: number of entries in @ns
9393
*/
94-
int nvme_scan_ctrl_namespaces(nvme_ctrl_t c, struct dirent ***namespaces);
94+
int nvme_scan_ctrl_namespaces(nvme_ctrl_t c, struct dirent ***ns);
9595

9696
#endif /* _LIBNVME_FILTERS_H */

0 commit comments

Comments
 (0)