1LFC_LISTREPLICAX(3)          LFC Library Functions         LFC_LISTREPLICAX(3)
2
3
4

NAME

6       lfc_listreplicax    -    list    replica    entries    for    a   given
7       pool/server/filesystem
8

SYNOPSIS

10       #include <sys/types.h>
11       #include "lfc_api.h"
12
13       struct lfc_filereplica *lfc_listreplicax (const char  *poolname,  const
14       char *server, const char *fs, int flags, lfc_list *listp)
15

DESCRIPTION

17       lfc_listreplicax lists replica entries for a given pool/server/filesys‐
18       tem.  This routine returns a pointer to a structure containing the cur‐
19       rent replica entry.
20
21       struct lfc_filereplica {
22            u_signed64     fileid;
23            u_signed64     nbaccesses;
24            time_t         atime;         /* last access to replica */
25            time_t         ptime;         /* replica pin time */
26            char      status;
27            char      f_type;        /* 'V' for Volatile, 'P' for Permanent */
28            char      poolname[CA_MAXPOOLNAMELEN+1];
29            char      host[CA_MAXHOSTNAMELEN+1];
30            char      fs[80];
31            char      sfn[CA_MAXSFNLEN+1];
32       };
33
34       poolname
35              specifies the disk pool (only meaningful for the DPM).
36
37       server specifies the Storage Element or disk server hostname.
38
39       fs     specifies the file system (only meaningful for the DPM).
40
41       flags  may be one of the following constant:
42
43              CNS_LIST_BEGIN
44                     the  first  call must have this flag set to allocate buf‐
45                     fers and initialize pointers.
46
47              CNS_LIST_CONTINUE
48                     all the following calls must have this flag set.
49
50              CNS_LIST_END
51                     final call to terminate the list and free resources.
52

RETURN VALUE

54       This routine returns a pointer to a structure  containing  the  current
55       replica  entry  if  the operation was successful or NULL if all entries
56       have been returned or if the operation failed. In the latter case, ser‐
57       rno is set appropriately.
58

EXAMPLES

60       A  C  program  listing  the files residing on a given server could look
61       like:
62
63            int flags;
64            lfc_list list;
65            struct lfc_filereplica *lp;
66
67            flags = CNS_LIST_BEGIN;
68            while ((lp = lfc_listreplicax (NULL, server, NULL, flags, &list))) {
69                 flags = CNS_LIST_CONTINUE;
70                 /* process the entry */
71                 .....
72            }
73            (void) lfc_listreplicax (NULL, server, NULL, CNS_LIST_END, &list);
74

ERRORS

76       ENOMEM       Memory could not be allocated for the output buffer.
77
78       EFAULT       poolname, server and fs are NULL pointers or  listp  is  a
79                    NULL pointer.
80
81       EINVAL       The  length  of  poolname exceeds CA_MAXPOOLNAMELEN or the
82                    length of server exceeds CA_MAXHOSTNAMELEN or  the  length
83                    of fs exceeds 79.
84
85       SENOSHOST    Host unknown.
86
87       SENOSSERV    Service unknown.
88
89       SECOMERR     Communication error.
90
91       ENSNACT      Name server is not running or is being shutdown.
92

SEE ALSO

94       Castor_limits(4), lfc_addreplica(3)
95
96
97
98LFC                      $Date: 2005/07/21 08:31:48 $      LFC_LISTREPLICAX(3)
Impressum