Whamcloud - gitweb
LU-14286 osd-ldiskfs: fallocate() should zero new blocks
[fs/lustre-release.git] / lustre / doc / llapi_search_tgt.3
1 .TH llapi_search_tgt 3 "2019 Jun 06" "Lustre User API"
2 .SH NAME
3 llapi_search_tgt \- verify OST or MDT is in specified pool
4 .SH SYNOPSIS
5 .nf
6 .B #include <lustre/lustreapi.h>
7 .PP
8 .IB int " llapi_search_tgt(" "const char *fsname" ", " "const char *pool_name" ,
9 .BI                              "const char *tgt_name" ", " "bool is_mdt" );
10 .PP
11 .IB int " llapi_search_mdt(" "const char *fsname" ", " "const char *pool_name" ,
12 .BI                              "const char *tgt_name" );
13 .PP
14 .IB int " llapi_search_ost(" "const char *fsname" ", " "const char *pool_name" ,
15 .BI                              "const char *tgt_name" );
16 .SH DESCRIPTION
17 .PP
18 .B llapi_search_tgt()
19 verifies that the specified
20 .I tgt_name
21 is a valid MDT or OST (depending on whether
22 .I is_mdt
23 is
24 .B true
25 or
26 .BR false ,
27 respectively) in the filesystem named
28 .I fsname
29 and (if specified) in the pool named
30 .I pool_name
31 of that filesystem.  At least
32 .I fsname
33 must be non-NULL, but
34 .I pool_name
35 may be
36 .B NULL
37 if just checking for the existence of the target, and
38 .I tgt_name
39 may be
40 .BR NULL ,
41 if only checking the existence of
42 .IR pool_name .
43 .PP
44 The
45 .B llapi_search_mdt()
46 and
47 .B llapi_search_ost()
48 functions are simple convenience/compatibility wrappers of
49 .B llapi_search_tgt()
50 that set
51 .I is_mdt
52 appropriately for the target type.
53 .SH RETURN VALUES
54 .LP
55 .B llapi_search_tgt()
56 returns 1 if
57 .I tgt_name
58 (or
59 .I pool_name
60 if
61 .I tgt_name
62 is
63 .BR NULL )
64 is found in the specified pool
65 (or
66 .I filesystem
67 if
68 .I pool_name
69 is
70 .BR NULL ).
71 It returns 0 if
72 .I tgt_name
73 .RI ( pool_name )
74 if it is not found in the specified pool
75 .RI ( filesystem ).
76 A negative errno is returned if an error occurred, in which case errno
77 is also set appropriately.
78 .SH ERRORS
79 .TP 15
80 .SM EINVAL
81 .I fsname
82 is NULL or zero-length, or both
83 .I pool_name
84 and
85 .I tgt_name
86 are
87 .BR NULL .
88 .TP 15
89 .SM ENOENT
90 .I pool_name
91 is specified but is not part of
92 .IR fsname .
93 .SH "SEE ALSO"
94 .BR llapi_pool_name_verify (3),
95 .BR lustreapi (7),
96 .BR lustre (7)