// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2016 Tom Haynes <loghyr@primarydata.com> * * The following implements a super-simple flex-file server * where the NFSv4.1 mds is also the ds. And the storage is * the same. I.e., writing to the mds via a NFSv4.1 WRITE * goes to the same location as the NFSv3 WRITE.
*/ #include <linux/slab.h>
/* * The super simple flex file server has 1 mirror, 1 data server, * and 1 file handle. So instead of 4 allocs, do 1 for now. * Zero it out for the stateid - don't want junk in there!
*/
error = -ENOMEM;
fl = kzalloc(sizeof(*fl), GFP_KERNEL); if (!fl) goto out_error;
args->lg_content = fl;
/* * Avoid layout commit, try to force the I/O to the DS, * and for fun, cause all IOMODE_RW layout segments to * effectively be WRITE only.
*/
fl->flags = FF_FLAGS_NO_LAYOUTCOMMIT | FF_FLAGS_NO_IO_THRU_MDS |
FF_FLAGS_NO_READ_IO;
/* Do not allow a IOMODE_READ segment to have write pemissions */ if (seg->iomode == IOMODE_READ) {
u = from_kuid(&init_user_ns, inode->i_uid) + 1;
fl->uid = make_kuid(&init_user_ns, u);
} else
fl->uid = inode->i_uid;
fl->gid = inode->i_gid;
error = nfsd4_set_deviceid(&fl->deviceid, fhp, device_generation); if (error) goto out_error;
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.