ReactOS  0.4.13-dev-259-g5ca9c9c
pnfs_debug.c File Reference
#include <winsock2.h>
#include <strsafe.h>
#include "pnfs.h"
#include "daemon_debug.h"
Include dependency graph for pnfs_debug.c:

Go to the source code of this file.

Macros

#define MULTI_ADDR_BUFFER_LEN   (NFS41_ADDRS_PER_SERVER*(NFS41_UNIVERSAL_ADDR_LEN+1)+1)
 

Functions

const charpnfs_error_string (enum pnfs_status status)
 
const charpnfs_layout_type_string (enum pnfs_layout_type type)
 
const charpnfs_iomode_string (enum pnfs_iomode iomode)
 
void dprint_deviceid (IN int level, IN const char *title, IN const unsigned char *deviceid)
 
void dprint_layout (IN int level, IN const pnfs_file_layout *layout)
 
static void dprint_multi_addr (IN int level, IN uint32_t index, IN const multi_addr4 *addrs)
 
void dprint_device (IN int level, IN const pnfs_file_device *device)
 

Macro Definition Documentation

◆ MULTI_ADDR_BUFFER_LEN

#define MULTI_ADDR_BUFFER_LEN   (NFS41_ADDRS_PER_SERVER*(NFS41_UNIVERSAL_ADDR_LEN+1)+1)

Definition at line 96 of file pnfs_debug.c.

Function Documentation

◆ dprint_device()

void dprint_device ( IN int  level,
IN const pnfs_file_device device 
)

Definition at line 113 of file pnfs_debug.c.

116 {
117  uint32_t i;
118  dprint_deviceid(level, " deviceid: ", device->device.deviceid);
119  dprintf(level, " type: %s\n", pnfs_layout_type_string(device->device.type));
120  dprintf(level, " stripes: %u\n", device->stripes.count);
121  for (i = 0; i < device->servers.count; i++)
122  dprint_multi_addr(level, i, &device->servers.arr[i].addrs);
123 }
GLint level
Definition: gl.h:1546
static void dprint_multi_addr(IN int level, IN uint32_t index, IN const multi_addr4 *addrs)
Definition: pnfs_debug.c:99
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: devices.h:37
#define dprintf
Definition: regdump.c:33
const char * pnfs_layout_type_string(enum pnfs_layout_type type)
Definition: pnfs_debug.c:48
void dprint_deviceid(IN int level, IN const char *title, IN const unsigned char *deviceid)
Definition: pnfs_debug.c:68
UINT32 uint32_t
Definition: types.h:75

◆ dprint_deviceid()

void dprint_deviceid ( IN int  level,
IN const char title,
IN const unsigned char deviceid 
)

Definition at line 68 of file pnfs_debug.c.

72 {
73  /* deviceid is 16 bytes, so print it as 4 uints */
74  uint32_t *p = (uint32_t*)deviceid;
75  dprintf(level, "%s%08X.%08X.%08X.%08X\n",
76  title, htonl(p[0]), htonl(p[1]), htonl(p[2]), htonl(p[3]));
77 }
GLint level
Definition: gl.h:1546
#define htonl(x)
Definition: module.h:212
#define dprintf
Definition: regdump.c:33
UINT32 uint32_t
Definition: types.h:75
GLfloat GLfloat p
Definition: glext.h:8902
static char title[]
Definition: ps.c:92

Referenced by dprint_device(), and dprint_layout().

◆ dprint_layout()

void dprint_layout ( IN int  level,
IN const pnfs_file_layout layout 
)

Definition at line 79 of file pnfs_debug.c.

82 {
83  dprintf(level, " type: %s\n", pnfs_layout_type_string(layout->layout.type));
84  dprintf(level, " iomode: %s\n", pnfs_iomode_string(layout->layout.iomode));
85  dprint_deviceid(level, " deviceid: ", layout->deviceid);
86  dprintf(level, " offset: %llu\n", layout->layout.offset);
87  dprintf(level, " length: %llu\n", layout->layout.length);
88  dprintf(level, " pattern_offset: %llu\n", layout->pattern_offset);
89  dprintf(level, " first_index: %u\n", layout->first_index);
90  dprintf(level, " dense: %u\n", is_dense(layout));
91  dprintf(level, " commit_to_mds: %u\n", should_commit_to_mds(layout));
92  dprintf(level, " stripe_unit_size: %u\n", layout_unit_size(layout));
93  dprintf(level, " file handles: %u\n", layout->filehandles.count);
94 }
GLint level
Definition: gl.h:1546
const char * pnfs_iomode_string(enum pnfs_iomode iomode)
Definition: pnfs_debug.c:58
__inline uint32_t layout_unit_size(IN const pnfs_file_layout *layout)
Definition: pnfs.h:315
#define dprintf
Definition: regdump.c:33
const char * pnfs_layout_type_string(enum pnfs_layout_type type)
Definition: pnfs_debug.c:48
__inline int should_commit_to_mds(IN const pnfs_file_layout *layout)
Definition: pnfs.h:306
void dprint_deviceid(IN int level, IN const char *title, IN const unsigned char *deviceid)
Definition: pnfs_debug.c:68
static DWORD layout
Definition: bitmap.c:46
__inline int is_dense(IN const pnfs_file_layout *layout)
Definition: pnfs.h:297

◆ dprint_multi_addr()

static void dprint_multi_addr ( IN int  level,
IN uint32_t  index,
IN const multi_addr4 addrs 
)
static

Definition at line 99 of file pnfs_debug.c.

103 {
104  char buffer[MULTI_ADDR_BUFFER_LEN] = "";
105  uint32_t i;
106  for (i = 0; i < addrs->count; i++) {
107  StringCchCatA(buffer, MULTI_ADDR_BUFFER_LEN, addrs->arr[i].uaddr);
109  }
110  dprintf(level, " servers[%d]: [ %s]\n", index, buffer);
111 }
GLint level
Definition: gl.h:1546
#define MULTI_ADDR_BUFFER_LEN
Definition: pnfs_debug.c:96
GLuint buffer
Definition: glext.h:5915
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
STRSAFEAPI StringCchCatA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
Definition: strsafe.h:320
#define dprintf
Definition: regdump.c:33
GLuint index
Definition: glext.h:6031
UINT32 uint32_t
Definition: types.h:75

Referenced by dprint_device().

◆ pnfs_error_string()

const char* pnfs_error_string ( enum pnfs_status  status)

Definition at line 28 of file pnfs_debug.c.

29 {
30  switch (status) {
31  case PNFS_SUCCESS: return "PNFS_SUCCESS";
32  case PNFS_PENDING: return "PNFS_PENDING";
33  case PNFS_READ_EOF: return "PNFS_READ_EOF";
34  case PNFSERR_NOT_SUPPORTED: return "PNFSERR_NOT_SUPPORTED";
35  case PNFSERR_NOT_CONNECTED: return "PNFSERR_NOT_CONNECTED";
36  case PNFSERR_IO: return "PNFSERR_IO";
37  case PNFSERR_NO_DEVICE: return "PNFSERR_NO_DEVICE";
38  case PNFSERR_NO_LAYOUT: return "PNFSERR_NO_LAYOUT";
39  case PNFSERR_INVALID_FH_LIST: return "PNFSERR_INVALID_FH_LIST";
40  case PNFSERR_INVALID_DS_INDEX: return "PNFSERR_INVALID_DS_INDEX";
41  case PNFSERR_RESOURCES: return "PNFSERR_RESOURCES";
42  case PNFSERR_LAYOUT_RECALLED: return "PNFSERR_LAYOUT_RECALLED";
43  case PNFSERR_LAYOUT_CHANGED: return "PNFSERR_LAYOUT_CHANGED";
44  default: return "Invalid pnfs status";
45  }
46 }
Definition: ps.c:97

Referenced by file_device_find_or_create(), file_layout_fetch(), file_layout_read_thread(), file_layout_recall_all(), file_layout_recall_file(), file_layout_recall_fsid(), file_layout_return(), file_layout_write_thread(), layout_state_find_and_delete(), layout_state_find_or_create(), pattern_fork(), pnfs_file_device_get(), pnfs_file_device_notify(), pnfs_file_layout_recall(), pnfs_layout_state_close(), pnfs_layout_state_open(), pnfs_read(), and pnfs_write().

◆ pnfs_iomode_string()

const char* pnfs_iomode_string ( enum pnfs_iomode  iomode)

Definition at line 58 of file pnfs_debug.c.

59 {
60  switch (iomode) {
61  case PNFS_IOMODE_READ: return "PNFS_IOMODE_READ";
62  case PNFS_IOMODE_RW: return "PNFS_IOMODE_RW";
63  case PNFS_IOMODE_ANY: return "PNFS_IOMODE_ANY";
64  default: return "Invalid io mode";
65  }
66 }

Referenced by dprint_layout(), file_layout_fetch(), handle_cb_layoutrecall(), and pnfs_file_layout_recall().

◆ pnfs_layout_type_string()

const char* pnfs_layout_type_string ( enum pnfs_layout_type  type)

Definition at line 48 of file pnfs_debug.c.

49 {
50  switch (type) {
51  case PNFS_LAYOUTTYPE_FILE: return "PNFS_LAYOUTTYPE_FILE";
52  case PNFS_LAYOUTTYPE_OBJECT: return "PNFS_LAYOUTTYPE_OBJECT";
53  case PNFS_LAYOUTTYPE_BLOCK: return "PNFS_LAYOUTTYPE_BLOCK";
54  default: return "Invalid layout type";
55  }
56 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by dprint_device(), dprint_layout(), handle_cb_layoutrecall(), and pnfs_file_layout_recall().