1DPM_GETSPACEMD(3) DPM Library Functions DPM_GETSPACEMD(3)
2
3
4
6 dpm_getspacemd - get space metadata
7
9 #include <sys/types.h>
10 #include "dpm_api.h"
11
12 int dpm_getspacemd (int nbtokens, char **s_tokens, int *nbreplies,
13 struct dpm_space_metadata **spacemd)
14
16 dpm_getspacemd gets space metadata.
17
18 The input arguments are:
19
20 nbtokens
21 specifies the number of tokens in the request.
22
23 s_tokens
24 specifies an array of tokens returned by previous reservespace
25 requests.
26
27 The output arguments are:
28
29 nbreplies
30 will be set to the number of replies in the array of space meta‐
31 data.
32
33 spacemd
34 will be set to the address of an array of dpm_space_metadata
35 structures allocated by the API. The client application is
36 responsible for freeing the array when not needed anymore.
37
38 struct dpm_space_metadata {
39 char s_type;
40 char s_token[CA_MAXDPMTOKENLEN+1];
41 uid_t s_uid;
42 gid_t s_gid;
43 char ret_policy;
44 char ac_latency;
45 char u_token[256];
46 char client_dn[256];
47 u_signed64 t_space; /* Total space */
48 u_signed64 g_space; /* Guaranteed space */
49 signed64 u_space; /* Unused space */
50 char poolname[CA_MAXPOOLNAMELEN+1];
51 time_t a_lifetime; /* Lifetime assigned */
52 time_t r_lifetime; /* Remaining lifetime */
53 int nbgids;
54 gid_t *gids; /* restrict the space to given group(s) */
55 };
56
58 This routine returns 0 if the operation was successful or -1 if the
59 operation failed. In the latter case, serrno is set appropriately.
60
62 EFAULT s_tokens , nbreplies or spacemd is a NULL pointer.
63
64 ENOMEM Memory could not be allocated for storing the reply.
65
66 EINVAL nbtokens is not strictly positive or the specified tokens
67 are invalid/unknown.
68
69 SENOSHOST Host unknown.
70
71 SEINTERNAL Database error.
72
73 SECOMERR Communication error.
74
75
76
77LCG $Date: 2008/09/25 10:17:46 $ DPM_GETSPACEMD(3)