/* * Some clients barf on non-zero block numbers for NONE or INVALID * layouts, so make sure to zero the whole structure.
*/
error = -ENOMEM;
bex = kzalloc(sizeof(*bex), GFP_KERNEL); if (!bex) goto out_error;
args->lg_content = bex;
if (iomap.length < args->lg_minlength) {
dprintk("pnfsd: extent smaller than minlength\n"); goto out_layoutunavailable;
}
switch (iomap.type) { case IOMAP_MAPPED: if (seg->iomode == IOMODE_READ)
bex->es = PNFS_BLOCK_READ_DATA; else
bex->es = PNFS_BLOCK_READWRITE_DATA;
bex->soff = iomap.addr; break; case IOMAP_UNWRITTEN: if (seg->iomode & IOMODE_RW) { /* * Crack monkey special case from section 2.3.1.
*/ if (args->lg_minlength == 0) {
dprintk("pnfsd: no soup for you!\n"); goto out_layoutunavailable;
}
bex->es = PNFS_BLOCK_INVALID_DATA;
bex->soff = iomap.addr; break;
}
fallthrough; case IOMAP_HOLE: if (seg->iomode == IOMODE_READ) {
bex->es = PNFS_BLOCK_NONE_DATA; break;
}
fallthrough; case IOMAP_DELALLOC: default:
WARN(1, "pnfsd: filesystem returned %d extent\n", iomap.type); goto out_layoutunavailable;
}
conststruct nfsd4_layout_ops bl_layout_ops = { /* * Pretend that we send notification to the client. This is a blatant * lie to force recent Linux clients to cache our device IDs. * We rarely ever change the device ID, so the harm of leaking deviceids * for a while isn't too bad. Unfortunately RFC5661 is a complete mess * in this regard, but I filed errata 4119 for this a while ago, and * hopefully the Linux client will eventually start caching deviceids * without this again.
*/
.notify_types =
NOTIFY_DEVICEID4_DELETE | NOTIFY_DEVICEID4_CHANGE,
.proc_getdeviceinfo = nfsd4_block_proc_getdeviceinfo,
.encode_getdeviceinfo = nfsd4_block_encode_getdeviceinfo,
.proc_layoutget = nfsd4_block_proc_layoutget,
.encode_layoutget = nfsd4_block_encode_layoutget,
.proc_layoutcommit = nfsd4_block_proc_layoutcommit,
}; #endif/* CONFIG_NFSD_BLOCKLAYOUT */
/* * We use the client ID as a unique key for the reservations. * This allows us to easily fence a client when recalls fail.
*/ static u64 nfsd4_scsi_pr_key(struct nfs4_client *clp)
{ return ((u64)clp->cl_clientid.cl_boot << 32) | clp->cl_clientid.cl_id;
}
conststruct nfsd4_layout_ops scsi_layout_ops = { /* * Pretend that we send notification to the client. This is a blatant * lie to force recent Linux clients to cache our device IDs. * We rarely ever change the device ID, so the harm of leaking deviceids * for a while isn't too bad. Unfortunately RFC5661 is a complete mess * in this regard, but I filed errata 4119 for this a while ago, and * hopefully the Linux client will eventually start caching deviceids * without this again.
*/
.notify_types =
NOTIFY_DEVICEID4_DELETE | NOTIFY_DEVICEID4_CHANGE,
.proc_getdeviceinfo = nfsd4_scsi_proc_getdeviceinfo,
.encode_getdeviceinfo = nfsd4_block_encode_getdeviceinfo,
.proc_layoutget = nfsd4_block_proc_layoutget,
.encode_layoutget = nfsd4_block_encode_layoutget,
.proc_layoutcommit = nfsd4_scsi_proc_layoutcommit,
.fence_client = nfsd4_scsi_fence_client,
}; #endif/* CONFIG_NFSD_SCSILAYOUT */
Messung V0.5
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.