#include <windows.h>
#include <strsafe.h>
#include <stdio.h>
#include "nfs41_ops.h"
#include "nfs41_callback.h"
#include "daemon_debug.h"
Go to the source code of this file.
|
static enum pnfs_status | file_device_create (IN const unsigned char *deviceid, IN struct pnfs_file_device_list *devices, OUT pnfs_file_device **device_out) |
|
static void | file_device_free (IN pnfs_file_device *device) |
|
static int | deviceid_compare (const struct list_entry *entry, const void *deviceid) |
|
static enum pnfs_status | file_device_find_or_create (IN const unsigned char *deviceid, IN struct pnfs_file_device_list *devices, OUT pnfs_file_device **device_out) |
|
enum pnfs_status | pnfs_file_device_list_create (OUT struct pnfs_file_device_list **devices_out) |
|
void | pnfs_file_device_list_free (IN struct pnfs_file_device_list *devices) |
|
void | pnfs_file_device_list_invalidate (IN struct pnfs_file_device_list *devices) |
|
enum pnfs_status | pnfs_file_device_get (IN nfs41_session *session, IN struct pnfs_file_device_list *devices, IN unsigned char *deviceid, OUT pnfs_file_device **device_out) |
|
void | pnfs_file_device_put (IN pnfs_file_device *device) |
|
static enum pnfs_status | data_client_status (IN pnfs_data_server *server, OUT nfs41_client **client_out) |
|
enum pnfs_status | pnfs_data_server_client (IN nfs41_root *root, IN pnfs_data_server *server, IN uint32_t default_lease, OUT nfs41_client **client_out) |
|
enum pnfs_status | pnfs_file_device_notify (IN struct pnfs_file_device_list *devices, IN const struct notify_deviceid4 *change) |
|
◆ device_entry
◆ FDLVL
◆ data_client_status()
◆ deviceid_compare()
◆ file_device_create()
Definition at line 43 of file pnfs_device.c.
47{
50
55 }
56
63}
static struct all_devices * devices
#define memcpy(s1, s2, n)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Referenced by file_device_find_or_create().
◆ file_device_find_or_create()
Definition at line 82 of file pnfs_device.c.
86{
89
90 dprintf(
FDLVL,
"--> pnfs_file_device_find_or_create()\n");
91
93
94
97
101
104
106 "returning new device %p\n",
device);
107 } else {
110 }
111 } else {
114
116 "returning existing device %p\n", *device_out);
117 }
118
121}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static struct list_entry * list_search(const struct list_entry *head, const void *value, list_compare_fn compare)
const char * pnfs_error_string(enum pnfs_status status)
static enum pnfs_status file_device_create(IN const unsigned char *deviceid, IN struct pnfs_file_device_list *devices, OUT pnfs_file_device **device_out)
static int deviceid_compare(const struct list_entry *entry, const void *deviceid)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
Referenced by pnfs_file_device_get().
◆ file_device_free()
◆ pnfs_data_server_client()
Definition at line 283 of file pnfs_device.c.
288{
291
293 server->addrs.arr[0].uaddr);
294
295
299
300 if (!pnfsstat)
302
304
306 if (pnfsstat) {
310 dprintf(
FDLVL,
"data_client_create('%s') failed with %d\n",
312 } else {
313 *client_out =
server->client;
315
316 dprintf(
FDLVL,
"pnfs_data_server_client() returning new client "
317 "%llu\n",
server->client->clnt_id);
318 }
319 }
320
323 return pnfsstat;
324}
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
int nfs41_root_mount_addrs(IN nfs41_root *root, IN const multi_addr4 *addrs, IN bool_t is_data, IN OPTIONAL uint32_t lease_time, OUT nfs41_client **client_out)
static enum pnfs_status data_client_status(IN pnfs_data_server *server, OUT nfs41_client **client_out)
◆ pnfs_file_device_get()
Definition at line 192 of file pnfs_device.c.
197{
201
203
207
209
210
215 else {
220
223 } else {
225
226 eprintf(
"pnfs_rpc_getdeviceinfo() failed with %s\n",
228 }
229 }
230
232 device->device.layout_count++;
234 device->device.layout_count);
236 }
237
240 dprintf(
FDLVL,
"<-- pnfs_file_device_get() returning %s\n",
243}
void eprintf(LPCSTR format,...)
const char * nfs_error_string(int status)
void dprint_device(int level, const struct __pnfs_file_device *device)
enum nfsstat4 pnfs_rpc_getdeviceinfo(IN nfs41_session *session, IN unsigned char *deviceid, OUT pnfs_file_device *device)
static enum pnfs_status file_device_find_or_create(IN const unsigned char *deviceid, IN struct pnfs_file_device_list *devices, OUT pnfs_file_device **device_out)
◆ pnfs_file_device_list_create()
◆ pnfs_file_device_list_free()
Definition at line 144 of file pnfs_device.c.
146{
148
150
153
157}
#define list_for_each_tmp(entry, tmp, head)
static void file_device_free(IN pnfs_file_device *device)
Referenced by nfs41_client_free().
◆ pnfs_file_device_list_invalidate()
◆ pnfs_file_device_notify()
Definition at line 328 of file pnfs_device.c.
331{
334
335 dprintf(
FDLVL,
"--> pnfs_file_device_notify(%u, %0llX:%0llX)\n",
336 change->type, change->deviceid);
337
341 }
342
344
348
350
353
354
356 }
358 }
359
362 dprintf(
FDLVL,
"<-- pnfs_file_device_notify() returning %s\n",
365}
@ NOTIFY_DEVICEID4_DELETE
@ NOTIFY_DEVICEID4_CHANGE
Referenced by handle_cb_notify_deviceid().
◆ pnfs_file_device_put()