ReactOS  0.4.11-dev-946-g431643b
pnfs.h File Reference
#include "nfs41_types.h"
#include "list.h"
Include dependency graph for pnfs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __pnfs_device
 
struct  __pnfs_stripe_indices
 
struct  __pnfs_data_server
 
struct  __pnfs_data_server_list
 
struct  __pnfs_file_device
 
struct  __pnfs_layout_state
 
struct  __pnfs_layout
 
struct  __pnfs_file_layout_handles
 
struct  __pnfs_file_layout
 

Macros

#define PNFS_ENABLE_READ
 
#define PNFS_ENABLE_WRITE
 
#define PNFS_THREADING
 
#define NFL4_UFLG_MASK   0x0000003F
 
#define NFL4_UFLG_DENSE   0x00000001
 
#define NFL4_UFLG_COMMIT_THRU_MDS   0x00000002
 
#define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK   0xFFFFFFC0
 
#define PNFS_DEVICEID_SIZE   16
 

Typedefs

typedef struct __pnfs_device pnfs_device
 
typedef struct __pnfs_stripe_indices pnfs_stripe_indices
 
typedef struct __pnfs_data_server pnfs_data_server
 
typedef struct __pnfs_data_server_list pnfs_data_server_list
 
typedef struct __pnfs_file_device pnfs_file_device
 
typedef struct __pnfs_layout_state pnfs_layout_state
 
typedef struct __pnfs_layout pnfs_layout
 
typedef struct __pnfs_file_layout_handles pnfs_file_layout_handles
 
typedef struct __pnfs_file_layout pnfs_file_layout
 

Enumerations

enum  pnfs_status {
  PNFS_SUCCESS = 0, PNFS_PENDING, PNFS_READ_EOF, PNFSERR_NOT_SUPPORTED,
  PNFSERR_NOT_CONNECTED, PNFSERR_IO, PNFSERR_NO_DEVICE, PNFSERR_NO_LAYOUT,
  PNFSERR_INVALID_FH_LIST, PNFSERR_INVALID_DS_INDEX, PNFSERR_RESOURCES, PNFSERR_LAYOUT_RECALLED,
  PNFSERR_LAYOUT_CHANGED
}
 
enum  pnfs_layout_type { PNFS_LAYOUTTYPE_FILE = 1, PNFS_LAYOUTTYPE_OBJECT = 2, PNFS_LAYOUTTYPE_BLOCK = 3 }
 
enum  pnfs_iomode { PNFS_IOMODE_READ = 0x1, PNFS_IOMODE_RW = 0x2, PNFS_IOMODE_ANY = PNFS_IOMODE_READ | PNFS_IOMODE_RW }
 
enum  pnfs_layout_status { PNFS_LAYOUT_UNAVAILABLE = 0x10, PNFS_LAYOUT_NOT_RW = 0x20 }
 
enum  pnfs_device_status { PNFS_DEVICE_GRANTED = 0x1, PNFS_DEVICE_REVOKED = 0x2 }
 
enum  pnfs_return_type { PNFS_RETURN_FILE = 1, PNFS_RETURN_FSID = 2, PNFS_RETURN_ALL = 3 }
 

Functions

enum pnfs_status pnfs_layout_list_create (OUT struct pnfs_layout_list **layouts_out)
 
void pnfs_layout_list_free (IN struct pnfs_layout_list *layouts)
 
enum pnfs_status pnfs_layout_state_open (IN struct __nfs41_open_state *state, OUT pnfs_layout_state **layout_out)
 
enum pnfs_status pnfs_layout_state_prepare (IN pnfs_layout_state *state, IN struct __nfs41_session *session, IN nfs41_path_fh *meta_file, IN struct __stateid_arg *stateid, IN enum pnfs_iomode iomode, IN uint64_t offset, IN uint64_t length)
 
void pnfs_layout_state_close (IN struct __nfs41_session *session, IN struct __nfs41_open_state *state, IN bool_t remove)
 
enum pnfs_status pnfs_file_layout_recall (IN struct __nfs41_client *client, IN const struct cb_layoutrecall_args *recall)
 
enum pnfs_status pnfs_layout_recall_status (IN const pnfs_layout_state *state, IN const pnfs_layout *layout)
 
void pnfs_layout_recall_fenced (IN pnfs_layout_state *state, IN const pnfs_layout *layout)
 
void pnfs_layout_io_start (IN pnfs_layout_state *state)
 
void pnfs_layout_io_finished (IN pnfs_layout_state *state)
 
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 struct __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)
 
enum pnfs_status pnfs_file_device_notify (IN struct pnfs_file_device_list *devices, IN const struct notify_deviceid4 *change)
 
enum pnfs_status pnfs_data_server_client (IN struct __nfs41_root *root, IN pnfs_data_server *server, IN uint32_t default_lease, OUT struct __nfs41_client **client_out)
 
enum pnfs_status pnfs_read (IN struct __nfs41_root *root, IN struct __nfs41_open_state *state, IN struct __stateid_arg *stateid, IN pnfs_layout_state *layout, IN uint64_t offset, IN uint64_t length, OUT unsigned char *buffer_out, OUT ULONG *len_out)
 
enum pnfs_status pnfs_write (IN struct __nfs41_root *root, IN struct __nfs41_open_state *state, IN struct __stateid_arg *stateid, IN pnfs_layout_state *layout, IN uint64_t offset, IN uint64_t length, IN unsigned char *buffer, OUT ULONG *len_out, OUT nfs41_file_info *cinfo)
 
__inline int is_dense (IN const pnfs_file_layout *layout)
 
__inline int should_commit_to_mds (IN const pnfs_file_layout *layout)
 
__inline uint32_t layout_unit_size (IN const pnfs_file_layout *layout)
 
__inline uint64_t stripe_unit_number (IN const pnfs_file_layout *layout, IN uint64_t offset, IN uint32_t unit_size)
 
__inline uint64_t stripe_unit_offset (IN const pnfs_file_layout *layout, IN uint64_t sui, IN uint32_t unit_size)
 
__inline uint32_t stripe_index (IN const pnfs_file_layout *layout, IN uint64_t sui, IN uint32_t stripe_count)
 
__inline uint32_t data_server_index (IN const pnfs_file_device *device, IN uint32_t stripeid)
 

Macro Definition Documentation

◆ NFL4_UFLG_COMMIT_THRU_MDS

#define NFL4_UFLG_COMMIT_THRU_MDS   0x00000002

Definition at line 108 of file pnfs.h.

Referenced by should_commit_to_mds().

◆ NFL4_UFLG_DENSE

#define NFL4_UFLG_DENSE   0x00000001

Definition at line 107 of file pnfs.h.

Referenced by is_dense().

◆ NFL4_UFLG_MASK

#define NFL4_UFLG_MASK   0x0000003F

Definition at line 106 of file pnfs.h.

◆ NFL4_UFLG_STRIPE_UNIT_SIZE_MASK

#define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK   0xFFFFFFC0

Definition at line 109 of file pnfs.h.

Referenced by layout_unit_size().

◆ PNFS_DEVICEID_SIZE

◆ PNFS_ENABLE_READ

#define PNFS_ENABLE_READ

Definition at line 33 of file pnfs.h.

◆ PNFS_ENABLE_WRITE

#define PNFS_ENABLE_WRITE

Definition at line 36 of file pnfs.h.

◆ PNFS_THREADING

#define PNFS_THREADING

Definition at line 39 of file pnfs.h.

Typedef Documentation

◆ pnfs_data_server

◆ pnfs_data_server_list

◆ pnfs_device

◆ pnfs_file_device

◆ pnfs_file_layout

◆ pnfs_file_layout_handles

◆ pnfs_layout

◆ pnfs_layout_state

◆ pnfs_stripe_indices

Enumeration Type Documentation

◆ pnfs_device_status

Enumerator
PNFS_DEVICE_GRANTED 
PNFS_DEVICE_REVOKED 

Definition at line 93 of file pnfs.h.

93  {
94  /* GETDEVICEINFO was successful */
95  PNFS_DEVICE_GRANTED = 0x1,
96  /* a bulk recall or lease expiration led to device invalidation */
97  PNFS_DEVICE_REVOKED = 0x2,
98 };

◆ pnfs_iomode

Enumerator
PNFS_IOMODE_READ 
PNFS_IOMODE_RW 
PNFS_IOMODE_ANY 

Definition at line 80 of file pnfs.h.

◆ pnfs_layout_status

Enumerator
PNFS_LAYOUT_UNAVAILABLE 
PNFS_LAYOUT_NOT_RW 

Definition at line 86 of file pnfs.h.

86  {
87  /* a LAYOUTGET error indicated that this layout will never be granted */
89  /* LAYOUTGET returned BADIOMODE, so a RW layout will never be granted */
90  PNFS_LAYOUT_NOT_RW = 0x20,
91 };

◆ pnfs_layout_type

Enumerator
PNFS_LAYOUTTYPE_FILE 
PNFS_LAYOUTTYPE_OBJECT 
PNFS_LAYOUTTYPE_BLOCK 

Definition at line 74 of file pnfs.h.

◆ pnfs_return_type

Enumerator
PNFS_RETURN_FILE 
PNFS_RETURN_FSID 
PNFS_RETURN_ALL 

Definition at line 100 of file pnfs.h.

100  {
101  PNFS_RETURN_FILE = 1,
102  PNFS_RETURN_FSID = 2,
103  PNFS_RETURN_ALL = 3
104 };

◆ pnfs_status

Enumerator
PNFS_SUCCESS 
PNFS_PENDING 
PNFS_READ_EOF 
PNFSERR_NOT_SUPPORTED 
PNFSERR_NOT_CONNECTED 
PNFSERR_IO 
PNFSERR_NO_DEVICE 
PNFSERR_NO_LAYOUT 
PNFSERR_INVALID_FH_LIST 
PNFSERR_INVALID_DS_INDEX 
PNFSERR_RESOURCES 
PNFSERR_LAYOUT_RECALLED 
PNFSERR_LAYOUT_CHANGED 

Definition at line 58 of file pnfs.h.

Function Documentation

◆ data_server_index()

__inline uint32_t data_server_index ( IN const pnfs_file_device device,
IN uint32_t  stripeid 
)

Definition at line 358 of file pnfs.h.

Referenced by get_sparse_fh(), and thread_data_server().

364 {
365  return device->stripes.arr[stripeid];
366 }
Definition: devices.h:39

◆ is_dense()

__inline int is_dense ( IN const pnfs_file_layout layout)

Definition at line 297 of file pnfs.h.

Referenced by dprint_layout(), stripe_next_unit(), and thread_init().

302 {
303  return (layout->util & NFL4_UFLG_DENSE) != 0;
304 }
#define NFL4_UFLG_DENSE
Definition: pnfs.h:107
static DWORD layout
Definition: bitmap.c:46

◆ layout_unit_size()

__inline uint32_t layout_unit_size ( IN const pnfs_file_layout layout)

Definition at line 315 of file pnfs.h.

Referenced by dprint_layout(), layout_sanity_check(), and stripe_next_unit().

320 {
322 }
#define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK
Definition: pnfs.h:109
static DWORD layout
Definition: bitmap.c:46

◆ pnfs_data_server_client()

enum pnfs_status pnfs_data_server_client ( IN struct __nfs41_root root,
IN pnfs_data_server server,
IN uint32_t  default_lease,
OUT struct __nfs41_client **  client_out 
)

◆ pnfs_file_device_get()

enum pnfs_status pnfs_file_device_get ( IN struct __nfs41_session session,
IN struct pnfs_file_device_list devices,
IN unsigned char deviceid,
OUT pnfs_file_device **  device_out 
)

Referenced by device_fetch().

◆ pnfs_file_device_list_create()

enum pnfs_status pnfs_file_device_list_create ( OUT struct pnfs_file_device_list **  devices_out)

Definition at line 124 of file pnfs_device.c.

Referenced by pnfs_client_init().

126 {
129 
130  devices = calloc(1, sizeof(struct pnfs_file_device_list));
131  if (devices == NULL) {
132  status = PNFSERR_RESOURCES;
133  goto out;
134  }
135 
136  list_init(&devices->head);
137  InitializeCriticalSection(&devices->lock);
138 
139  *devices_out = devices;
140 out:
141  return status;
142 }
pnfs_status
Definition: pnfs.h:58
struct list_entry head
Definition: pnfs_device.c:36
const char * devices
Definition: diskspace.c:793
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
smooth NULL
Definition: ftsmooth.c:416
static FILE * out
Definition: regtests2xml.c:44
#define calloc
Definition: rosglue.h:14
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
CRITICAL_SECTION lock
Definition: pnfs_device.c:37
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ pnfs_file_device_list_free()

void pnfs_file_device_list_free ( IN struct pnfs_file_device_list devices)

Definition at line 144 of file pnfs_device.c.

Referenced by nfs41_client_free().

146 {
147  struct list_entry *entry, *tmp;
148 
150 
151  list_for_each_tmp(entry, tmp, &devices->head)
153 
156  free(devices);
157 }
rwlock_t lock
Definition: tcpcore.h:1163
static void file_device_free(IN pnfs_file_device *device)
Definition: pnfs_device.c:65
#define free
Definition: debug_ros.c:5
const char * devices
Definition: diskspace.c:793
uint8_t entry
Definition: isohybrid.c:63
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define device_entry(pos)
Definition: pnfs_device.c:40
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
Definition: list.h:27
#define list_for_each_tmp(entry, tmp, head)
Definition: list.h:39
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ pnfs_file_device_list_invalidate()

void pnfs_file_device_list_invalidate ( IN struct pnfs_file_device_list devices)

Definition at line 159 of file pnfs_device.c.

Referenced by file_layout_recall_all(), and file_layout_recall_fsid().

161 {
162  struct list_entry *entry, *tmp;
164 
165  dprintf(FDLVL, "--> pnfs_file_device_list_invalidate()\n");
166 
168 
169  list_for_each_tmp(entry, tmp, &devices->head) {
170  device = device_entry(entry);
171  EnterCriticalSection(&device->device.lock);
172  /* if there are layouts still using the device, flag it
173  * as revoked and clean up on last reference */
174  if (device->device.layout_count) {
175  device->device.status |= PNFS_DEVICE_REVOKED;
176  LeaveCriticalSection(&device->device.lock);
177  } else {
178  LeaveCriticalSection(&device->device.lock);
179  /* no layouts are using it, so it's safe to free */
180  list_remove(entry);
181  file_device_free(device);
182  }
183  }
184 
186 
187  dprintf(FDLVL, "<-- pnfs_file_device_list_invalidate()\n");
188 }
static void file_device_free(IN pnfs_file_device *device)
Definition: pnfs_device.c:65
uint32_t layout_count
Definition: pnfs.h:119
const char * devices
Definition: diskspace.c:793
uint8_t entry
Definition: isohybrid.c:63
CRITICAL_SECTION lock
Definition: pnfs.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define device_entry(pos)
Definition: pnfs_device.c:40
#define FDLVL
Definition: pnfs_device.c:31
Definition: devices.h:39
#define dprintf
Definition: regdump.c:33
pnfs_device device
Definition: pnfs.h:140
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
Definition: list.h:27
enum pnfs_device_status status
Definition: pnfs.h:118
#define list_for_each_tmp(entry, tmp, head)
Definition: list.h:39
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ pnfs_file_device_notify()

enum pnfs_status pnfs_file_device_notify ( IN struct pnfs_file_device_list devices,
IN const struct notify_deviceid4 change 
)

Definition at line 328 of file pnfs_device.c.

Referenced by handle_cb_notify_deviceid().

331 {
332  struct list_entry *entry;
334 
335  dprintf(FDLVL, "--> pnfs_file_device_notify(%u, %0llX:%0llX)\n",
336  change->type, change->deviceid);
337 
338  if (change->layouttype != PNFS_LAYOUTTYPE_FILE) {
339  status = PNFSERR_NOT_SUPPORTED;
340  goto out;
341  }
342 
344 
345  entry = list_search(&devices->head, change->deviceid, deviceid_compare);
346  if (entry) {
347  dprintf(FDLVL, "found file device %p\n", device_entry(entry));
348 
349  if (change->type == NOTIFY_DEVICEID4_CHANGE) {
350  /* if (change->immediate) ... */
351  dprintf(FDLVL, "CHANGE (%u)\n", change->immediate);
352  } else if (change->type == NOTIFY_DEVICEID4_DELETE) {
353  /* This notification MUST NOT be sent if the client
354  * has a layout that refers to the device ID. */
355  dprintf(FDLVL, "DELETE\n");
356  }
357  status = PNFS_SUCCESS;
358  }
359 
361 out:
362  dprintf(FDLVL, "<-- pnfs_file_device_notify() returning %s\n",
363  pnfs_error_string(status));
364  return status;
365 }
pnfs_status
Definition: pnfs.h:58
const char * devices
Definition: diskspace.c:793
uint8_t entry
Definition: isohybrid.c:63
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define device_entry(pos)
Definition: pnfs_device.c:40
#define FDLVL
Definition: pnfs_device.c:31
#define dprintf
Definition: regdump.c:33
const char * pnfs_error_string(enum pnfs_status status)
Definition: pnfs_debug.c:28
static FILE * out
Definition: regtests2xml.c:44
static struct list_entry * list_search(const struct list_entry *head, const void *value, list_compare_fn compare)
Definition: list.h:102
Definition: list.h:27
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static int deviceid_compare(const struct list_entry *entry, const void *deviceid)
Definition: pnfs_device.c:74
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ pnfs_file_device_put()

void pnfs_file_device_put ( IN pnfs_file_device device)

Definition at line 245 of file pnfs_device.c.

Referenced by file_layout_free().

247 {
248  uint32_t count;
249  EnterCriticalSection(&device->device.lock);
250  count = --device->device.layout_count;
251  dprintf(FDLVL, "pnfs_file_device_put() -> %u\n", count);
252 
253  /* if the device was revoked, remove/free the device on last reference */
254  if (count == 0 && device->device.status & PNFS_DEVICE_REVOKED) {
255  EnterCriticalSection(&device->devices->lock);
256  list_remove(&device->entry);
257  LeaveCriticalSection(&device->devices->lock);
258 
259  LeaveCriticalSection(&device->device.lock);
260 
262  dprintf(FDLVL, "revoked file device freed after last reference\n");
263  } else {
264  LeaveCriticalSection(&device->device.lock);
265  }
266 }
static void file_device_free(IN pnfs_file_device *device)
Definition: pnfs_device.c:65
GLuint GLuint GLsizei count
Definition: gl.h:1545
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define FDLVL
Definition: pnfs_device.c:31
Definition: devices.h:39
#define dprintf
Definition: regdump.c:33
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
UINT32 uint32_t
Definition: types.h:75
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ pnfs_file_layout_recall()

◆ pnfs_layout_io_finished()

void pnfs_layout_io_finished ( IN pnfs_layout_state state)

Definition at line 1267 of file pnfs_layout.c.

Referenced by pattern_free().

1269 {
1271 
1272  /* return the reference to signify that an io request is finished */
1273  state->io_count--;
1274  dprintf(FLLVL, "pnfs_layout_io_finished() count -> %u\n",
1275  state->io_count);
1276 
1277  if (state->io_count > 0) /* more io pending */
1278  goto out_unlock;
1279 
1280  /* once all io is finished, process any layout recalls */
1282 
1283  /* finish any segment merging that was delayed during io */
1284  if (!list_empty(&state->layouts))
1286 
1287 out_unlock:
1289 }
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:54
static enum pnfs_status layout_state_merge(IN pnfs_layout_state *state, IN pnfs_file_layout *from)
Definition: pnfs_layout.c:286
#define dprintf
Definition: regdump.c:33
#define FLLVL
Definition: pnfs_layout.c:30
static void layout_state_deferred_recalls(IN pnfs_layout_state *state)
Definition: pnfs_layout.c:960
static int state
Definition: maze.c:121
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:82
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
#define file_layout_entry(pos)
Definition: pnfs_layout.c:41

◆ pnfs_layout_io_start()

void pnfs_layout_io_start ( IN pnfs_layout_state state)

Definition at line 1257 of file pnfs_layout.c.

Referenced by pattern_init().

1259 {
1260  /* take a reference on the layout, so that it won't be recalled
1261  * until all io is finished */
1262  state->io_count++;
1263  dprintf(FLLVL, "pnfs_layout_io_start(): count -> %u\n",
1264  state->io_count);
1265 }
#define dprintf
Definition: regdump.c:33
#define FLLVL
Definition: pnfs_layout.c:30
static int state
Definition: maze.c:121

◆ pnfs_layout_list_create()

enum pnfs_status pnfs_layout_list_create ( OUT struct pnfs_layout_list **  layouts_out)

Definition at line 121 of file pnfs_layout.c.

Referenced by pnfs_client_init().

123 {
124  struct pnfs_layout_list *layouts;
126 
127  layouts = calloc(1, sizeof(struct pnfs_layout_list));
128  if (layouts == NULL) {
129  status = PNFSERR_RESOURCES;
130  goto out;
131  }
132  list_init(&layouts->head);
133  InitializeCriticalSection(&layouts->lock);
134  *layouts_out = layouts;
135 out:
136  return status;
137 }
pnfs_status
Definition: pnfs.h:58
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
smooth NULL
Definition: ftsmooth.c:416
static FILE * out
Definition: regtests2xml.c:44
CRITICAL_SECTION lock
Definition: pnfs_layout.c:36
struct list_entry head
Definition: pnfs_layout.c:35
#define calloc
Definition: rosglue.h:14
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ pnfs_layout_list_free()

void pnfs_layout_list_free ( IN struct pnfs_layout_list layouts)

Definition at line 139 of file pnfs_layout.c.

Referenced by nfs41_client_free(), and pnfs_client_init().

141 {
142  struct list_entry *entry, *tmp;
143 
144  EnterCriticalSection(&layouts->lock);
145 
146  list_for_each_tmp(entry, tmp, &layouts->head)
148 
149  LeaveCriticalSection(&layouts->lock);
150  DeleteCriticalSection(&layouts->lock);
151  free(layouts);
152 }
rwlock_t lock
Definition: tcpcore.h:1163
#define free
Definition: debug_ros.c:5
uint8_t entry
Definition: isohybrid.c:63
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static void layout_state_free(IN pnfs_layout_state *state)
Definition: pnfs_layout.c:93
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define state_entry(pos)
Definition: pnfs_layout.c:39
Definition: list.h:27
#define list_for_each_tmp(entry, tmp, head)
Definition: list.h:39
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ pnfs_layout_recall_fenced()

void pnfs_layout_recall_fenced ( IN pnfs_layout_state state,
IN const pnfs_layout layout 
)

Definition at line 1233 of file pnfs_layout.c.

Referenced by map_ds_error().

1236 {
1237  struct layout_recall *lrc = calloc(1, sizeof(struct layout_recall));
1238  if (lrc == NULL)
1239  return;
1240 
1242 
1243  list_init(&lrc->layout.entry);
1244  lrc->layout.offset = layout->offset;
1245  lrc->layout.length = layout->length;
1246  lrc->layout.iomode = layout->iomode;
1247  lrc->layout.type = layout->type;
1248  lrc->changed = TRUE;
1249 
1250  if (layout_recall_merge(&state->recalls, &lrc->layout) != PNFS_SUCCESS)
1251  list_add_tail(&state->recalls, &lrc->layout.entry);
1252 
1254 }
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:54
enum pnfs_layout_type type
Definition: pnfs.h:169
#define TRUE
Definition: types.h:120
enum pnfs_iomode iomode
Definition: pnfs.h:168
uint64_t offset
Definition: pnfs.h:166
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
smooth NULL
Definition: ftsmooth.c:416
static enum pnfs_status layout_recall_merge(IN struct list_entry *list, IN pnfs_layout *from)
Definition: pnfs_layout.c:992
uint64_t length
Definition: pnfs.h:167
struct list_entry entry
Definition: pnfs.h:165
static int state
Definition: maze.c:121
static DWORD layout
Definition: bitmap.c:46
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:82
pnfs_layout layout
Definition: pnfs_layout.c:869
bool_t changed
Definition: pnfs_layout.c:870
#define calloc
Definition: rosglue.h:14
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149

◆ pnfs_layout_recall_status()

enum pnfs_status pnfs_layout_recall_status ( IN const pnfs_layout_state state,
IN const pnfs_layout layout 
)

Definition at line 1211 of file pnfs_layout.c.

Referenced by thread_next_unit().

1214 {
1215  struct list_entry *entry;
1217 
1218  /* search for a pending recall that intersects with the given segment */
1219  list_for_each(entry, &state->recalls) {
1220  const struct layout_recall *recall = recall_entry(entry);
1221  if (!layout_recall_compatible(layout, &recall->layout))
1222  continue;
1223 
1224  if (recall->changed)
1225  status = PNFSERR_LAYOUT_CHANGED;
1226  else
1227  status = PNFSERR_LAYOUT_RECALLED;
1228  break;
1229  }
1230  return status;
1231 }
pnfs_status
Definition: pnfs.h:58
uint8_t entry
Definition: isohybrid.c:63
#define list_for_each(entry, head)
Definition: list.h:36
static int state
Definition: maze.c:121
static DWORD layout
Definition: bitmap.c:46
static bool_t layout_recall_compatible(IN const pnfs_layout *layout, IN const pnfs_layout *recall)
Definition: pnfs_layout.c:874
pnfs_layout layout
Definition: pnfs_layout.c:869
#define recall_entry(pos)
Definition: pnfs_layout.c:872
Definition: list.h:27
bool_t changed
Definition: pnfs_layout.c:870
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ pnfs_layout_state_close()

void pnfs_layout_state_close ( IN struct __nfs41_session session,
IN struct __nfs41_open_state state,
IN bool_t  remove 
)

Referenced by handle_close().

◆ pnfs_layout_state_open()

enum pnfs_status pnfs_layout_state_open ( IN struct __nfs41_open_state state,
OUT pnfs_layout_state **  layout_out 
)

Referenced by read_from_pnfs(), and write_to_pnfs().

◆ pnfs_layout_state_prepare()

enum pnfs_status pnfs_layout_state_prepare ( IN pnfs_layout_state state,
IN struct __nfs41_session session,
IN nfs41_path_fh meta_file,
IN struct __stateid_arg stateid,
IN enum pnfs_iomode  iomode,
IN uint64_t  offset,
IN uint64_t  length 
)

Referenced by pnfs_read(), and pnfs_write().

◆ pnfs_read()

enum pnfs_status pnfs_read ( IN struct __nfs41_root root,
IN struct __nfs41_open_state state,
IN struct __stateid_arg stateid,
IN pnfs_layout_state layout,
IN uint64_t  offset,
IN uint64_t  length,
OUT unsigned char buffer_out,
OUT ULONG len_out 
)

Referenced by read_from_pnfs().

◆ pnfs_write()

enum pnfs_status pnfs_write ( IN struct __nfs41_root root,
IN struct __nfs41_open_state state,
IN struct __stateid_arg stateid,
IN pnfs_layout_state layout,
IN uint64_t  offset,
IN uint64_t  length,
IN unsigned char buffer,
OUT ULONG len_out,
OUT nfs41_file_info cinfo 
)

Referenced by write_to_pnfs().

◆ should_commit_to_mds()

__inline int should_commit_to_mds ( IN const pnfs_file_layout layout)

Definition at line 306 of file pnfs.h.

Referenced by dprint_layout(), file_layout_write_thread(), and mds_commit().

311 {
312  return (layout->util & NFL4_UFLG_COMMIT_THRU_MDS) != 0;
313 }
#define NFL4_UFLG_COMMIT_THRU_MDS
Definition: pnfs.h:108
static DWORD layout
Definition: bitmap.c:46

◆ stripe_index()

__inline uint32_t stripe_index ( IN const pnfs_file_layout layout,
IN uint64_t  sui,
IN uint32_t  stripe_count 
)

Definition at line 347 of file pnfs.h.

Referenced by stripe_next_unit().

354 {
355  return (uint32_t)((sui + layout->first_index) % stripe_count);
356 }
static DWORD layout
Definition: bitmap.c:46
UINT32 uint32_t
Definition: types.h:75

◆ stripe_unit_number()

__inline uint64_t stripe_unit_number ( IN const pnfs_file_layout layout,
IN uint64_t  offset,
IN uint32_t  unit_size 
)

Definition at line 324 of file pnfs.h.

Referenced by stripe_next_unit().

331 {
332  const uint64_t relative_offset = offset - layout->pattern_offset;
333  return relative_offset / unit_size;
334 }
GLintptr offset
Definition: glext.h:5920
static DWORD layout
Definition: bitmap.c:46
UINT64 uint64_t
Definition: types.h:77

◆ stripe_unit_offset()

__inline uint64_t stripe_unit_offset ( IN const pnfs_file_layout layout,
IN uint64_t  sui,
IN uint32_t  unit_size 
)

Definition at line 336 of file pnfs.h.

Referenced by stripe_next_unit().

343 {
344  return layout->pattern_offset + unit_size * sui;
345 }
static DWORD layout
Definition: bitmap.c:46