5
5
* Copyright (C) 2008 Lawrence Livermore National Security.
6
6
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
7
7
* Written by Danny Auble <da@llnl.gov>
8
* CODE-OCEC-09-009. All rights reserved.
10
10
* This file is part of SLURM, a resource management program.
11
* For details, see <http://www.llnl.gov/linux/slurm/>.
11
* For details, see <https://computing.llnl.gov/linux/slurm/>.
12
* Please also read the included file: DISCLAIMER.
13
14
* SLURM is free software; you can redistribute it and/or modify it under
14
15
* the terms of the GNU General Public License as published by the Free
62
63
void (*remove_assoc_notify) (acct_association_rec_t *rec);
63
64
} assoc_init_args_t;
66
extern List assoc_mgr_association_list;
67
extern List assoc_mgr_qos_list;
68
extern List assoc_mgr_user_list;
69
extern List assoc_mgr_wckey_list;
71
extern acct_association_rec_t *assoc_mgr_root_assoc;
65
72
extern pthread_mutex_t assoc_mgr_association_lock;
73
extern pthread_mutex_t assoc_mgr_qos_lock;
74
extern pthread_mutex_t assoc_mgr_user_lock;
75
extern pthread_mutex_t assoc_mgr_file_lock;
76
extern pthread_mutex_t assoc_mgr_wckey_lock;
79
* get info from the storage
80
* IN: assoc - acct_association_rec_t with at least cluster and
81
* account set for account association. To get user
82
* association set user, and optional partition.
83
* Sets "id" field with the association ID.
84
* IN: enforce - return an error if no such association exists
85
* IN/OUT: assoc_list - contains a list of assoc_rec ptrs to
86
* associations this user has in the list. This
87
* list should be created with list_create(NULL)
88
* since we are putting pointers to memory used elsewhere.
89
* RET: SLURM_SUCCESS on success, else SLURM_ERROR
91
extern int assoc_mgr_get_user_assocs(void *db_conn,
92
acct_association_rec_t *assoc,
68
97
* get info from the storage
73
102
* IN: enforce - return an error if no such association exists
74
103
* IN/OUT: assoc_pptr - if non-NULL then return a pointer to the
75
104
* acct_association record in cache on success
76
106
* RET: SLURM_SUCCESS on success, else SLURM_ERROR
78
108
extern int assoc_mgr_fill_in_assoc(void *db_conn,
85
115
* IN/OUT: user - acct_user_rec_t with the name set of the user.
86
116
* "default_account" will be filled in on
87
117
* successful return DO NOT FREE.
118
* IN/OUT: user_pptr - if non-NULL then return a pointer to the
119
* acct_user record in cache on success
88
121
* RET: SLURM_SUCCESS on success SLURM_ERROR else
90
123
extern int assoc_mgr_fill_in_user(void *db_conn, acct_user_rec_t *user,
125
acct_user_rec_t **user_pptr);
94
128
* get info from the storage
129
* IN/OUT: qos - acct_qos_rec_t with the id set of the qos.
130
* IN/OUT: qos_pptr - if non-NULL then return a pointer to the
131
* acct_qos record in cache on success
133
* RET: SLURM_SUCCESS on success SLURM_ERROR else
135
extern int assoc_mgr_fill_in_qos(void *db_conn, acct_qos_rec_t *qos,
137
acct_qos_rec_t **qos_pptr);
139
* get info from the storage
95
140
* IN/OUT: wckey - acct_wckey_rec_t with the name, cluster and user
96
141
* for the wckey association.
97
142
* Sets "id" field with the wckey ID.
125
170
extern int assoc_mgr_init(void *db_conn, assoc_init_args_t *args);
126
171
extern int assoc_mgr_fini(char *state_save_location);
129
* update associations in local cache
130
* IN: acct_update_object_t *object
131
* RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
133
extern int assoc_mgr_update_local_assocs(acct_update_object_t *update);
136
* update wckeys in local cache
137
* IN: acct_update_object_t *object
138
* RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
140
extern int assoc_mgr_update_local_wckeys(acct_update_object_t *update);
143
* update qos in local cache
144
* IN: acct_update_object_t *object
145
* RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
147
extern int assoc_mgr_update_local_qos(acct_update_object_t *update);
150
* update users in local cache
151
* IN: acct_update_object_t *object
152
* RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
154
extern int assoc_mgr_update_local_users(acct_update_object_t *update);
174
* get the share information from the association list in the form of
175
* a list containing association_share_object_t's
176
* IN: uid: uid_t of user issuing the request
177
* IN: acct_list: char * list of accounts you want (NULL for all)
178
* IN: user_list: char * list of user names you want (NULL for all)
180
extern List assoc_mgr_get_shares(
181
void *db_conn, uid_t uid, List acct_list, List user_list);
184
* update associations in cache
185
* IN: acct_update_object_t *object
186
* RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
188
extern int assoc_mgr_update_assocs(acct_update_object_t *update);
191
* update wckeys in cache
192
* IN: acct_update_object_t *object
193
* RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
195
extern int assoc_mgr_update_wckeys(acct_update_object_t *update);
198
* update qos in cache
199
* IN: acct_update_object_t *object
200
* RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
202
extern int assoc_mgr_update_qos(acct_update_object_t *update);
205
* update users in cache
206
* IN: acct_update_object_t *object
207
* RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
209
extern int assoc_mgr_update_users(acct_update_object_t *update);
157
212
* validate that an association ID is still valid
178
233
extern int dump_assoc_mgr_state(char *state_save_location);
236
* Read in the usage for association if the database
237
* is up when starting.
239
extern int load_assoc_usage(char *state_save_location);
181
242
* Read in the information of the association mgr if the database
182
243
* isn't up when starting.