1DPNS_LISTREPLICAX(3) DPNS Library Functions DP‐
2NS_LISTREPLICAX(3)
3
4
5
6[1mNAME[0m
7 dpns_listreplicax ‐ list replica entries
8for a given
9 pool/server/filesystem
10
11[1mSYNOPSIS[0m
12 [1m#include <sys/types.h>[0m
13 [1m#include "dpns_api.h"[0m
14
15 [1mstruct dpns_filereplica *dpns_listreplicax (const char
16*[4m[22mpoolname[24m[1m, const[0m
17 [1mchar *[4m[22mserver[24m[1m, const char
18*[4m[22mfs[24m[1m, int [4m[22mflags[24m[1m, dpns_list
19*[4m[22mlistp[24m[1m)[0m
20
21[1mDESCRIPTION[0m
22 [1mdpns_listreplicax [22mlists replica entries
23for a given
24 pool/server/filesystem. This routine returns a pointer to
25a structure
26 containing the current replica entry.
27
28 struct dpns_filereplica {
29 u_signed64 fileid;
30 u_signed64 nbaccesses;
31 time_t atime; /* last access to
32replica */
33 time_t ptime; /* replica pin time */
34 char status;
35 char f_type; /* ’V’ for Volatile, ’P’ for
36Permanent */
37 char poolname[CA_MAXPOOLNAMELEN+1];
38 char host[CA_MAXHOSTNAMELEN+1];
39 char fs[80];
40 char sfn[CA_MAXSFNLEN+1];
41 };
42
43 [4mpoolname[0m
44 specifies the disk pool (only meaningful for the
45DPM).
46
47 [4mserver[24m specifies the Storage Element or disk server
48hostname.
49
50 [4mfs[24m specifies the file system (only meaningful
51for the DPM).
52
53 [4mflags[24m may be one of the following constant:
54
55 [1mCNS_LIST_BEGIN[0m
56 the first call must have this flag set to
57allocate buf‐
58 fers and initialize pointers.
59
60 [1mCNS_LIST_CONTINUE[0m
61 all the following calls must have this flag
62set.
63
64 [1mCNS_LIST_END[0m
65 final call to terminate the list and free
66resources.
67
68[1mRETURN VALUE[0m
69 This routine returns a pointer to a structure containing
70the current
71 replica entry if the operation was successful or NULL
72if all entries
73 have been returned or if the operation failed. In the lat‐
74ter case, [1mser‐[0m
75 [1mrno [22mis set appropriately.
76
77[1mEXAMPLES[0m
78 A C program listing the files residing on a given
79server could look
80 like:
81
82 int flags;
83 dpns_list list;
84 struct dpns_filereplica *lp;
85
86 flags = CNS_LIST_BEGIN;
87 while ((lp = dpns_listreplicax (NULL, server, NULL,
88flags, &list))) {
89 flags = CNS_LIST_CONTINUE;
90 /* process the entry */
91 .....
92 }
93 (void) dpns_listreplicax (NULL, server, NULL,
94CNS_LIST_END, &list);
95
96[1mERRORS[0m
97 [1mENOMEM [22mMemory could not be allocated for the
98output buffer.
99
100 [1mEFAULT [4m[22mpoolname[24m, [4mserver[24m and
101[4mfs[24m are NULL pointers or [4mlistp[24m is a
102 NULL pointer.
103
104 [1mEINVAL [22mThe length of [4mpoolname[24m ex‐
105ceeds [1mCA_MAXPOOLNAMELEN [22mor the
106 length of [4mserver[24m exceeds [1mCA_MAX‐
107HOSTNAMELEN [22mor the length
108 of [4mfs[24m exceeds 79.
109
110 [1mSENOSHOST [22mHost unknown.
111
112 [1mSENOSSERV [22mService unknown.
113
114 [1mSECOMERR [22mCommunication error.
115
116 [1mENSNACT [22mName server is not running or is being
117shutdown.
118
119[1mSEE ALSO[0m
120 [1mCastor_limits(4)[22m, [1mdpns_addreplica(3)[0m
121
122
123
124DPNS $Date: 2005/07/21 08:31:48 $ DP‐
125NS_LISTREPLICAX(3)
126
127
128
129
130
131
132