if (lsra->lsra_lsr[i].lsr_index != index)
GOTO(out, rc = -EINVAL);
+ mutex_lock(&fld->lsf_lock);
rc1 = fld_insert_entry(env, fld, &lsra->lsra_lsr[i]);
+ mutex_unlock(&fld->lsf_lock);
+
if (rc1 != 0)
GOTO(out, rc = rc1);
}
* changed between declare and create.
* Because the fld entry can only be increamental, so we will only check
* whether it can be merged from the left.
+ *
+ * Caller must hold fld->lsf_lock
**/
int fld_index_create(const struct lu_env *env, struct lu_server_fld *fld,
const struct lu_seq_range *new_range, struct thandle *th)
RETURN(rc);
}
+/**
+ * insert entry in fld store.
+ *
+ * \param env relevant lu_env
+ * \param fld fld store
+ * \param range range to be inserted
+ *
+ * \retval 0 success
+ * \retval -ve error
+ *
+ * Caller must hold fld->lsf_lock
+ **/
+
int fld_insert_entry(const struct lu_env *env,
struct lu_server_fld *fld,
const struct lu_seq_range *range)
int rc;
ENTRY;
+ LASSERT(mutex_is_locked(&fld->lsf_lock));
+
th = dt_trans_create(env, lu2dt_dev(fld->lsf_obj->do_lu.lo_dev));
if (IS_ERR(th))
RETURN(PTR_ERR(th));
*
* lustre/fld/fld_internal.h
*
+ * Subsystem Description:
+ * FLD is FID Location Database, which stores where (IE, on which MDT)
+ * FIDs are located.
+ * The database is basically a record file, each record consists of a FID
+ * sequence range, MDT/OST index, and flags. The FLD for the whole FS
+ * is only stored on the sequence controller(MDT0) right now, but each target
+ * also has its local FLD, which only stores the local sequence.
+ *
+ * The FLD subsystem usually has two tasks:
+ * 1. maintain the database, i.e. when the sequence controller allocates
+ * new sequence ranges to some nodes, it will call the FLD API to insert the
+ * location information <sequence_range, node_index> in FLDB.
+ *
+ * 2. Handle requests from other nodes, i.e. if client needs to know where
+ * the FID is located, if it can not find the information in the local cache,
+ * it will send a FLD lookup RPC to the FLD service, and the FLD service will
+ * look up the FLDB entry and return the location information to client.
+ *
* Author: Yury Umanets <umka@clusterfs.com>
* Author: Tom WangDi <wangdi@clusterfs.com>
*/