ReactOS 0.4.15-dev-5666-gc548b97
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.

◆ NFL4_UFLG_DENSE

#define NFL4_UFLG_DENSE   0x00000001

Definition at line 107 of file pnfs.h.

◆ 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.

◆ PNFS_DEVICEID_SIZE

#define PNFS_DEVICEID_SIZE   16

Definition at line 111 of file pnfs.h.

◆ 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 */
96 /* a bulk recall or lease expiration led to device invalidation */
98};
@ PNFS_DEVICE_REVOKED
Definition: pnfs.h:97
@ PNFS_DEVICE_GRANTED
Definition: pnfs.h:95

◆ pnfs_iomode

Enumerator
PNFS_IOMODE_READ 
PNFS_IOMODE_RW 
PNFS_IOMODE_ANY 

Definition at line 80 of file pnfs.h.

80 {
81 PNFS_IOMODE_READ = 0x1,
82 PNFS_IOMODE_RW = 0x2,
84};
@ PNFS_IOMODE_ANY
Definition: pnfs.h:83
@ PNFS_IOMODE_READ
Definition: pnfs.h:81
@ PNFS_IOMODE_RW
Definition: pnfs.h:82

◆ 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_NOT_RW
Definition: pnfs.h:90
@ PNFS_LAYOUT_UNAVAILABLE
Definition: pnfs.h:88

◆ pnfs_layout_type

Enumerator
PNFS_LAYOUTTYPE_FILE 
PNFS_LAYOUTTYPE_OBJECT 
PNFS_LAYOUTTYPE_BLOCK 

Definition at line 74 of file pnfs.h.

74 {
78};
@ PNFS_LAYOUTTYPE_OBJECT
Definition: pnfs.h:76
@ PNFS_LAYOUTTYPE_FILE
Definition: pnfs.h:75
@ PNFS_LAYOUTTYPE_BLOCK
Definition: pnfs.h:77

◆ pnfs_return_type

Enumerator
PNFS_RETURN_FILE 
PNFS_RETURN_FSID 
PNFS_RETURN_ALL 

Definition at line 100 of file pnfs.h.

100 {
104};
@ PNFS_RETURN_FSID
Definition: pnfs.h:102
@ PNFS_RETURN_ALL
Definition: pnfs.h:103
@ PNFS_RETURN_FILE
Definition: pnfs.h:101

◆ 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.

58 {
59 PNFS_SUCCESS = 0,
72};
@ PNFSERR_NOT_SUPPORTED
Definition: pnfs.h:62
@ PNFSERR_IO
Definition: pnfs.h:64
@ PNFS_PENDING
Definition: pnfs.h:60
@ PNFSERR_NOT_CONNECTED
Definition: pnfs.h:63
@ PNFSERR_LAYOUT_CHANGED
Definition: pnfs.h:71
@ PNFSERR_NO_LAYOUT
Definition: pnfs.h:66
@ PNFSERR_INVALID_FH_LIST
Definition: pnfs.h:67
@ PNFSERR_RESOURCES
Definition: pnfs.h:69
@ PNFS_READ_EOF
Definition: pnfs.h:61
@ PNFSERR_NO_DEVICE
Definition: pnfs.h:65
@ PNFSERR_INVALID_DS_INDEX
Definition: pnfs.h:68
@ PNFSERR_LAYOUT_RECALLED
Definition: pnfs.h:70
@ PNFS_SUCCESS
Definition: pnfs.h:59

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.

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

Referenced by get_sparse_fh(), and thread_data_server().

◆ is_dense()

__inline int is_dense ( IN const pnfs_file_layout layout)

Definition at line 297 of file pnfs.h.

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

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

◆ layout_unit_size()

__inline uint32_t layout_unit_size ( IN const pnfs_file_layout layout)

Definition at line 315 of file pnfs.h.

320{
322}
#define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK
Definition: pnfs.h:109

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

◆ 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.

126{
129
130 devices = calloc(1, sizeof(struct pnfs_file_device_list));
131 if (devices == NULL) {
133 goto out;
134 }
135
136 list_init(&devices->head);
138
139 *devices_out = devices;
140out:
141 return status;
142}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define NULL
Definition: types.h:112
static struct all_devices * devices
Definition: dsm_ctrl.c:48
pnfs_status
Definition: pnfs.h:58
static FILE * out
Definition: regtests2xml.c:44
#define calloc
Definition: rosglue.h:14
Definition: ps.c:97
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751

Referenced by pnfs_client_init().

◆ 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.

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

Referenced by nfs41_client_free().

◆ 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.

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) {
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 */
182 }
183 }
184
186
187 dprintf(FDLVL, "<-- pnfs_file_device_list_invalidate()\n");
188}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
#define FDLVL
Definition: pnfs_device.c:31
#define dprintf
Definition: regdump.c:33

Referenced by file_layout_recall_all(), and file_layout_recall_fsid().

◆ 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.

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) {
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 }
358 }
359
361out:
362 dprintf(FDLVL, "<-- pnfs_file_device_notify() returning %s\n",
364 return status;
365}
static struct list_entry * list_search(const struct list_entry *head, const void *value, list_compare_fn compare)
Definition: list.h:102
const char * pnfs_error_string(enum pnfs_status status)
Definition: pnfs_debug.c:28
@ NOTIFY_DEVICEID4_DELETE
@ NOTIFY_DEVICEID4_CHANGE
static int deviceid_compare(const struct list_entry *entry, const void *deviceid)
Definition: pnfs_device.c:74

Referenced by handle_cb_notify_deviceid().

◆ pnfs_file_device_put()

void pnfs_file_device_put ( IN pnfs_file_device device)

Definition at line 245 of file pnfs_device.c.

247{
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}
UINT32 uint32_t
Definition: types.h:75
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by file_layout_free().

◆ 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.

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
1287out_unlock:
1289}
static int state
Definition: maze.c:121
static int list_empty(struct list_entry *head)
Definition: list.h:58
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:54
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:82
static enum pnfs_status layout_state_merge(IN pnfs_layout_state *state, IN pnfs_file_layout *from)
Definition: pnfs_layout.c:286
#define FLLVL
Definition: pnfs_layout.c:30
#define file_layout_entry(pos)
Definition: pnfs_layout.c:41
static void layout_state_deferred_recalls(IN pnfs_layout_state *state)
Definition: pnfs_layout.c:960

Referenced by pattern_free().

◆ pnfs_layout_io_start()

void pnfs_layout_io_start ( IN pnfs_layout_state state)

Definition at line 1257 of file pnfs_layout.c.

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}

Referenced by pattern_init().

◆ 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.

123{
124 struct pnfs_layout_list *layouts;
126
127 layouts = calloc(1, sizeof(struct pnfs_layout_list));
128 if (layouts == NULL) {
130 goto out;
131 }
132 list_init(&layouts->head);
134 *layouts_out = layouts;
135out:
136 return status;
137}
CRITICAL_SECTION lock
Definition: pnfs_layout.c:36
struct list_entry head
Definition: pnfs_layout.c:35

Referenced by pnfs_client_init().

◆ pnfs_layout_list_free()

void pnfs_layout_list_free ( IN struct pnfs_layout_list layouts)

Definition at line 139 of file pnfs_layout.c.

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}
static void layout_state_free(IN pnfs_layout_state *state)
Definition: pnfs_layout.c:93
#define state_entry(pos)
Definition: pnfs_layout.c:39

Referenced by nfs41_client_free(), and pnfs_client_init().

◆ 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.

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}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define TRUE
Definition: types.h:120
static enum pnfs_status layout_recall_merge(IN struct list_entry *list, IN pnfs_layout *from)
Definition: pnfs_layout.c:992
uint64_t offset
Definition: pnfs.h:166
enum pnfs_layout_type type
Definition: pnfs.h:169
enum pnfs_iomode iomode
Definition: pnfs.h:168
uint64_t length
Definition: pnfs.h:167
struct list_entry entry
Definition: pnfs.h:165
bool_t changed
Definition: pnfs_layout.c:870
pnfs_layout layout
Definition: pnfs_layout.c:869

Referenced by map_ds_error().

◆ 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.

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)
1226 else
1228 break;
1229 }
1230 return status;
1231}
#define list_for_each(entry, head)
Definition: list.h:36
static bool_t layout_recall_compatible(IN const pnfs_layout *layout, IN const pnfs_layout *recall)
Definition: pnfs_layout.c:874
#define recall_entry(pos)
Definition: pnfs_layout.c:872

Referenced by thread_next_unit().

◆ 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.

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

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

◆ 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.

354{
355 return (uint32_t)((sui + layout->first_index) % stripe_count);
356}

Referenced by stripe_next_unit().

◆ 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.

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

Referenced by stripe_next_unit().

◆ 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.

343{
344 return layout->pattern_offset + unit_size * sui;
345}

Referenced by stripe_next_unit().