NM_FL_MAP_UID_ONLY = 0x8,
NM_FL_MAP_GID_ONLY = 0x10,
NM_FL_ENABLE_AUDIT = 0x20,
NM_FL_MAP_UID_ONLY = 0x8,
NM_FL_MAP_GID_ONLY = 0x10,
NM_FL_ENABLE_AUDIT = 0x20,
static void nodemap_cluster_rec_init(union nodemap_rec *nr,
const struct lu_nodemap *nodemap)
{
static void nodemap_cluster_rec_init(union nodemap_rec *nr,
const struct lu_nodemap *nodemap)
{
nr->ncr.ncr_squash_uid = cpu_to_le32(nodemap->nm_squash_uid);
nr->ncr.ncr_squash_gid = cpu_to_le32(nodemap->nm_squash_gid);
nr->ncr.ncr_flags = cpu_to_le32(
nr->ncr.ncr_squash_uid = cpu_to_le32(nodemap->nm_squash_uid);
nr->ncr.ncr_squash_gid = cpu_to_le32(nodemap->nm_squash_gid);
nr->ncr.ncr_flags = cpu_to_le32(
(nodemap->nmf_map_gid_only ?
NM_FL_MAP_GID_ONLY : 0) |
(nodemap->nmf_enable_audit ?
(nodemap->nmf_map_gid_only ?
NM_FL_MAP_GID_ONLY : 0) |
(nodemap->nmf_enable_audit ?
dt_write_lock(env, idx, 0);
rc = dt_insert(env, idx, (const struct dt_rec *)nr,
dt_write_lock(env, idx, 0);
rc = dt_insert(env, idx, (const struct dt_rec *)nr,
nodemap_inc_version(env, idx, th);
dt_write_unlock(env, idx);
nodemap_inc_version(env, idx, th);
dt_write_unlock(env, idx);
GOTO(out_lock, rc);
rc = dt_insert(env, idx, (const struct dt_rec *)nr,
GOTO(out_lock, rc);
rc = dt_insert(env, idx, (const struct dt_rec *)nr,
if (nodemap_id == LUSTRE_NODEMAP_DEFAULT_ID) {
nodemap = nodemap_create(rec->ncr.ncr_name,
config, 1);
if (nodemap_id == LUSTRE_NODEMAP_DEFAULT_ID) {
nodemap = nodemap_create(rec->ncr.ncr_name,
config, 1);
flags & NM_FL_MAP_GID_ONLY;
nodemap->nmf_enable_audit =
flags & NM_FL_ENABLE_AUDIT;
flags & NM_FL_MAP_GID_ONLY;
nodemap->nmf_enable_audit =
flags & NM_FL_ENABLE_AUDIT;
/* The fileset should be saved otherwise it will be empty
* every time in case of "NODEMAP_CLUSTER_IDX". */
/* The fileset should be saved otherwise it will be empty
* every time in case of "NODEMAP_CLUSTER_IDX". */
if (new_config->nmc_default_nodemap == NULL) {
/* new MGS won't have a default nm on disk, so create it here */
if (new_config->nmc_default_nodemap == NULL) {
/* new MGS won't have a default nm on disk, so create it here */
} else {
rc = nodemap_idx_nodemap_add_update(
new_config->nmc_default_nodemap,
} else {
rc = nodemap_idx_nodemap_add_update(
new_config->nmc_default_nodemap,
int nodemap_get_config_req(struct obd_device *mgs_obd,
struct ptlrpc_request *req)
{
int nodemap_get_config_req(struct obd_device *mgs_obd,
struct ptlrpc_request *req)
{
struct mgs_config_body *body;
struct mgs_config_res *res;
struct lu_rdpg rdpg;
struct idx_info nodemap_ii;
struct ptlrpc_bulk_desc *desc;
struct mgs_config_body *body;
struct mgs_config_res *res;
struct lu_rdpg rdpg;
struct idx_info nodemap_ii;
struct ptlrpc_bulk_desc *desc;
body->mcb_name, rdpg.rp_count);
/* allocate pages to store the containers */
body->mcb_name, rdpg.rp_count);
/* allocate pages to store the containers */
page_count = (bytes + PAGE_SIZE - 1) >> PAGE_SHIFT;
LASSERT(page_count <= rdpg.rp_count);
desc = ptlrpc_prep_bulk_exp(req, page_count, 1,
page_count = (bytes + PAGE_SIZE - 1) >> PAGE_SHIFT;
LASSERT(page_count <= rdpg.rp_count);
desc = ptlrpc_prep_bulk_exp(req, page_count, 1,
- PTLRPC_BULK_PUT_SOURCE |
- PTLRPC_BULK_BUF_KIOV,
- MGS_BULK_PORTAL,
- &ptlrpc_bulk_kiov_pin_ops);
+ PTLRPC_BULK_PUT_SOURCE,
+ MGS_BULK_PORTAL, frag_ops);
- ptlrpc_prep_bulk_page_pin(desc, rdpg.rp_pages[i], 0,
- min_t(int, bytes, PAGE_SIZE));
+ frag_ops->add_kiov_frag(desc, rdpg.rp_pages[i], 0,
+ min_t(int, bytes, PAGE_SIZE));
for (i = 0; i < rdpg.rp_npages; i++)
if (rdpg.rp_pages[i] != NULL)
__free_page(rdpg.rp_pages[i]);
for (i = 0; i < rdpg.rp_npages; i++)
if (rdpg.rp_pages[i] != NULL)
__free_page(rdpg.rp_pages[i]);