pnfs: support for mdsthreshold attribute
hacked up and tested against bluearc server Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
e3c67c0bfa
commit
0c2148da5b
2 changed files with 72 additions and 0 deletions
|
|
@ -161,8 +161,28 @@ typedef struct __fs_locations4 {
|
||||||
uint32_t location_count;
|
uint32_t location_count;
|
||||||
} fs_locations4;
|
} fs_locations4;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
MDSTHRESH_READ = 0,
|
||||||
|
MDSTHRESH_WRITE,
|
||||||
|
MDSTHRESH_READ_IO,
|
||||||
|
MDSTHRESH_WRITE_IO,
|
||||||
|
|
||||||
|
MAX_MDSTHRESH_HINTS
|
||||||
|
};
|
||||||
|
typedef struct __threshold_item4 {
|
||||||
|
uint32_t type;
|
||||||
|
uint64_t hints[MAX_MDSTHRESH_HINTS];
|
||||||
|
} threshold_item4;
|
||||||
|
|
||||||
|
#define MAX_MDSTHRESHOLD_ITEMS 1
|
||||||
|
typedef struct __mdsthreshold4 {
|
||||||
|
uint32_t count;
|
||||||
|
threshold_item4 items[MAX_MDSTHRESHOLD_ITEMS];
|
||||||
|
} mdsthreshold4;
|
||||||
|
|
||||||
typedef struct __nfs41_file_info {
|
typedef struct __nfs41_file_info {
|
||||||
nfs41_fsid fsid;
|
nfs41_fsid fsid;
|
||||||
|
mdsthreshold4 mdsthreshold;
|
||||||
nfstime4 time_access;
|
nfstime4 time_access;
|
||||||
nfstime4 time_create;
|
nfstime4 time_create;
|
||||||
nfstime4 time_modify;
|
nfstime4 time_modify;
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,52 @@ static bool_t xdr_layout_types(
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool_t xdr_threshold_item(
|
||||||
|
XDR *xdr,
|
||||||
|
threshold_item4 *item)
|
||||||
|
{
|
||||||
|
bitmap4 bitmap;
|
||||||
|
|
||||||
|
if (!xdr_u_int32_t(xdr, &item->type))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!xdr_bitmap4(xdr, &bitmap))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!xdr_u_int32_t(xdr, &bitmap.count))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (bitmap.count) {
|
||||||
|
if (bitmap.arr[0] & 0x1 && !xdr_u_hyper(xdr, &item->hints[0]))
|
||||||
|
return FALSE;
|
||||||
|
if (bitmap.arr[0] & 0x2 && !xdr_u_hyper(xdr, &item->hints[1]))
|
||||||
|
return FALSE;
|
||||||
|
if (bitmap.arr[0] & 0x4 && !xdr_u_hyper(xdr, &item->hints[2]))
|
||||||
|
return FALSE;
|
||||||
|
if (bitmap.arr[0] & 0x8 && !xdr_u_hyper(xdr, &item->hints[3]))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool_t xdr_mdsthreshold(
|
||||||
|
XDR *xdr,
|
||||||
|
mdsthreshold4 *mdsthreshold)
|
||||||
|
{
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
if (!xdr_u_int32_t(xdr, &mdsthreshold->count))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (mdsthreshold->count > MAX_MDSTHRESHOLD_ITEMS)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
for (i = 0; i < mdsthreshold->count; i++)
|
||||||
|
if (!xdr_threshold_item(xdr, &mdsthreshold->items[i]))
|
||||||
|
return FALSE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* pathname4
|
/* pathname4
|
||||||
* decode a variable array of components into a nfs41_abs_path */
|
* decode a variable array of components into a nfs41_abs_path */
|
||||||
static bool_t decode_pathname4(
|
static bool_t decode_pathname4(
|
||||||
|
|
@ -1652,6 +1698,12 @@ static bool_t decode_file_attrs(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (attrs->attrmask.count >= 3) {
|
||||||
|
if (attrs->attrmask.arr[2] & FATTR4_WORD2_MDSTHRESHOLD) {
|
||||||
|
if (!xdr_mdsthreshold(xdr, &info->mdsthreshold))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue