range_cpu_to_be(tmp, tmp);
rc = dt_insert(env, fld->lsf_obj, (struct dt_rec *)tmp,
- (struct dt_key *)&tmp->lsr_start, th, 1);
+ (struct dt_key *)&tmp->lsr_start, th);
if (rc != 0) {
CERROR("%s: insert range "DRANGE" failed: rc = %d\n",
fld->lsf_name, PRANGE(new_range), rc);
* \param[in] pos position in the object to start
* \param[out] pos \a pos + bytes written
* \param[in] th transaction handle
- * \param[in] ignore unused (was used to request quota ignorance)
*
* \retval positive bytes written on success
* \retval negative negated errno on error
struct dt_object *dt,
const struct lu_buf *buf,
loff_t *pos,
- struct thandle *th,
- int ignore);
+ struct thandle *th);
/**
* Return buffers for data.
* \param[in] rec buffer storing value
* \param[in] key key
* \param[in] th transaction handle
- * \param[in] ignore unused (was used to request quota ignorance)
*
* \retval 0 on success
* \retval negative negated errno on error
struct dt_object *dt,
const struct dt_rec *rec,
const struct dt_key *key,
- struct thandle *th,
- int ignore);
+ struct thandle *th);
/**
* Declare intention to delete a key/value from an index.
static inline ssize_t dt_write(const struct lu_env *env, struct dt_object *dt,
const struct lu_buf *buf, loff_t *pos,
- struct thandle *th, int rq)
+ struct thandle *th)
{
LASSERT(dt);
LASSERT(dt->do_body_ops);
LASSERT(dt->do_body_ops->dbo_write);
- return dt->do_body_ops->dbo_write(env, dt, buf, pos, th, rq);
+ return dt->do_body_ops->dbo_write(env, dt, buf, pos, th);
}
static inline int dt_declare_punch(const struct lu_env *env,
}
static inline int dt_insert(const struct lu_env *env,
- struct dt_object *dt,
- const struct dt_rec *rec,
- const struct dt_key *key,
- struct thandle *th,
- int noquota)
+ struct dt_object *dt,
+ const struct dt_rec *rec,
+ const struct dt_key *key,
+ struct thandle *th)
{
LASSERT(dt);
LASSERT(dt->do_index_ops);
if (CFS_FAULT_CHECK(OBD_FAIL_DT_INSERT))
return cfs_fail_err;
- return dt->do_index_ops->dio_insert(env, dt, rec, key, th, noquota);
+ return dt->do_index_ops->dio_insert(env, dt, rec, key, th);
}
static inline int dt_declare_xattr_del(const struct lu_env *env,
int sptlrpc_pack_user_desc(struct lustre_msg *msg, int offset);
int sptlrpc_unpack_user_desc(struct lustre_msg *req, int offset, int swabbed);
-
-#define CFS_CAP_CHOWN_MASK (1 << CFS_CAP_CHOWN)
-#define CFS_CAP_SYS_RESOURCE_MASK (1 << CFS_CAP_SYS_RESOURCE)
-
/** @} sptlrpc */
#endif /* _LUSTRE_SEC_H_ */
GOTO(unlock, rc);
rc = dt_insert(env, obj, (const struct dt_rec *)rec,
- (const struct dt_key *)key, th, 1);
+ (const struct dt_key *)key, th);
GOTO(unlock, rc);
GOTO(stop, rc);
rc = dt_insert(env, lpf, (const struct dt_rec *)dtrec,
- (const struct dt_key *)name, th, 1);
+ (const struct dt_key *)name, th);
if (rc != 0)
GOTO(stop, rc);
struct dt_object *dt,
const struct dt_rec *rec,
const struct dt_key *key,
- struct thandle *handle,
- int ignore_quota)
+ struct thandle *handle)
{
return -EOPNOTSUPP;
}
/* 3b. insert dot into child dir */
rec->rec_fid = cfid;
rc = dt_insert(env, child, (const struct dt_rec *)rec,
- (const struct dt_key *)dot, th, 1);
+ (const struct dt_key *)dot, th);
if (rc != 0)
GOTO(unlock, rc);
/* 4b. insert dotdot into child dir */
rec->rec_fid = &LU_LPF_FID;
rc = dt_insert(env, child, (const struct dt_rec *)rec,
- (const struct dt_key *)dotdot, th, 1);
+ (const struct dt_key *)dotdot, th);
if (rc != 0)
GOTO(unlock, rc);
/* 6b. insert name into parent dir */
rec->rec_fid = cfid;
rc = dt_insert(env, parent, (const struct dt_rec *)rec,
- (const struct dt_key *)name, th, 1);
+ (const struct dt_key *)name, th);
if (rc != 0)
GOTO(stop, rc);
rec->rec_type = S_IFDIR;
rec->rec_fid = cfid;
rc = dt_insert(env, child, (const struct dt_rec *)rec,
- (const struct dt_key *)dot, th, 1);
+ (const struct dt_key *)dot, th);
if (rc != 0)
GOTO(unlock, rc);
/* 4b. insert dotdot into child dir */
rec->rec_fid = &LU_LPF_FID;
rc = dt_insert(env, child, (const struct dt_rec *)rec,
- (const struct dt_key *)dotdot, th, 1);
+ (const struct dt_key *)dotdot, th);
if (rc != 0)
GOTO(unlock, rc);
/* 5b. insert name into parent dir */
rc = dt_insert(env, parent, (const struct dt_rec *)rec,
- (const struct dt_key *)name, th, 1);
+ (const struct dt_key *)name, th);
if (rc != 0)
GOTO(stop, rc);
if (new != 0) {
rc = dt_insert(env, obj, (const struct dt_rec *)&new,
- (const struct dt_key *)key, th, 1);
+ (const struct dt_key *)key, th);
if (rc != 0)
GOTO(log, rc);
}
rec->rec_type = S_IFDIR;
rec->rec_fid = pfid;
rc = dt_insert(env, orphan, (const struct dt_rec *)rec,
- (const struct dt_key *)dotdot, th, 1);
+ (const struct dt_key *)dotdot, th);
if (rc != 0)
GOTO(unlock, rc);
}
rec->rec_type = lfsck_object_type(orphan) & S_IFMT;
rec->rec_fid = cfid;
rc = dt_insert(env, parent, (const struct dt_rec *)rec,
- (const struct dt_key *)cname->ln_name, th, 1);
+ (const struct dt_key *)cname->ln_name, th);
if (rc == 0 && S_ISDIR(rec->rec_type)) {
dt_write_lock(env, parent, 0);
rc = dt_ref_add(env, parent, th);
GOTO(stop, rc);
rc = dt_insert(env, parent, (const struct dt_rec *)rec,
- (const struct dt_key *)name, th, 1);
+ (const struct dt_key *)name, th);
if (rc != 0)
GOTO(stop, rc);
rec->rec_fid = cfid;
rc = dt_insert(env, orphan, (const struct dt_rec *)rec,
- (const struct dt_key *)dot, th, 1);
+ (const struct dt_key *)dot, th);
if (rc != 0)
GOTO(unlock2, rc);
rec->rec_fid = lfsck_dto2fid(parent);
rc = dt_insert(env, orphan, (const struct dt_rec *)rec,
- (const struct dt_key *)dotdot, th, 1);
+ (const struct dt_key *)dotdot, th);
if (rc != 0)
GOTO(unlock2, rc);
rec->rec_fid = cfid;
rc = dt_insert(env, parent, (const struct dt_rec *)rec,
- (const struct dt_key *)name, th, 1);
+ (const struct dt_key *)name, th);
if (rc == 0) {
dt_write_lock(env, parent, 0);
rc = dt_ref_add(env, parent, th);
GOTO(stop, rc);
rc = dt_insert(env, parent, (const struct dt_rec *)rec,
- (const struct dt_key *)name, th, 1);
+ (const struct dt_key *)name, th);
GOTO(stop, rc = (rc == 0 ? 1 : rc));
if (update) {
rc = dt_insert(env, parent,
(const struct dt_rec *)rec,
- (const struct dt_key *)name2, th, 1);
+ (const struct dt_key *)name2, th);
if (rc != 0)
GOTO(unlock2, rc);
}
dt_delete(env, obj, (const struct dt_key *)dotdot, th);
rc = dt_insert(env, obj, (const struct dt_rec *)rec,
- (const struct dt_key *)dotdot, th, 1);
+ (const struct dt_key *)dotdot, th);
if (rc != 0)
GOTO(unlock, rc);
rec->rec_type = S_IFDIR;
rec->rec_fid = cfid;
rc = dt_insert(env, child, (const struct dt_rec *)rec,
- (const struct dt_key *)dot, th, 1);
+ (const struct dt_key *)dot, th);
if (rc != 0)
GOTO(unlock, rc);
/* 4b. insert dotdot into child dir */
rec->rec_fid = pfid;
rc = dt_insert(env, child, (const struct dt_rec *)rec,
- (const struct dt_key *)dotdot, th, 1);
+ (const struct dt_key *)dotdot, th);
if (rc != 0)
GOTO(unlock, rc);
/* b5. insert child's FID into the LFSCK trace file. */
rc = dt_insert(env, obj, (const struct dt_rec *)&flags,
- (const struct dt_key *)key, th, 1);
+ (const struct dt_key *)key, th);
GOTO(stop, rc = (rc == 0 ? 1 : rc));
GOTO(stop, rc);
rc = dt_insert(env, dir, (const struct dt_rec *)rec,
- (const struct dt_key *)name, th, 1);
+ (const struct dt_key *)name, th);
if (rc == 0 && S_ISDIR(type) && !exists) {
dt_write_lock(env, dir, 0);
rc = dt_ref_add(env, dir, th);
struct thandle *th);
int lod_sub_insert(const struct lu_env *env, struct dt_object *dt,
const struct dt_rec *rec, const struct dt_key *key,
- struct thandle *th, int ign);
+ struct thandle *th);
int lod_sub_declare_delete(const struct lu_env *env, struct dt_object *dt,
const struct dt_key *key, struct thandle *th);
int lod_sub_delete(const struct lu_env *env, struct dt_object *dt,
struct thandle *th);
ssize_t lod_sub_write(const struct lu_env *env, struct dt_object *dt,
const struct lu_buf *buf, loff_t *pos,
- struct thandle *th, int rq);
+ struct thandle *th);
int lod_sub_declare_punch(const struct lu_env *env, struct dt_object *dt,
__u64 start, __u64 end, struct thandle *th);
int lod_sub_punch(const struct lu_env *env, struct dt_object *dt,
*/
static int lod_insert(const struct lu_env *env, struct dt_object *dt,
const struct dt_rec *rec, const struct dt_key *key,
- struct thandle *th, int ign)
+ struct thandle *th)
{
- return lod_sub_insert(env, dt_object_child(dt), rec, key, th, ign);
+ return lod_sub_insert(env, dt_object_child(dt), rec, key, th);
}
/**
rec->rec_fid = lu_object_fid(&dto->do_lu);
rc = lod_sub_insert(env, dto,
(const struct dt_rec *)rec,
- (const struct dt_key *)dot, th, 0);
+ (const struct dt_key *)dot, th);
if (rc != 0)
GOTO(out, rc);
}
rec->rec_fid = lu_object_fid(&dt->do_lu);
rc = lod_sub_insert(env, dto, (struct dt_rec *)rec,
- (const struct dt_key *)dotdot, th, 0);
+ (const struct dt_key *)dotdot, th);
if (rc != 0)
GOTO(out, rc);
rec->rec_fid = lu_object_fid(&dto->do_lu);
rc = lod_sub_insert(env, dt_object_child(dt),
(const struct dt_rec *)rec,
- (const struct dt_key *)stripe_name, th, 0);
+ (const struct dt_key *)stripe_name, th);
if (rc != 0)
GOTO(out, rc);
*/
static ssize_t lod_write(const struct lu_env *env, struct dt_object *dt,
const struct lu_buf *buf, loff_t *pos,
- struct thandle *th, int iq)
+ struct thandle *th)
{
LASSERT(S_ISREG(dt->do_lu.lo_header->loh_attr) ||
S_ISLNK(dt->do_lu.lo_header->loh_attr));
- return lod_sub_write(env, dt_object_child(dt), buf, pos, th, iq);
+ return lod_sub_write(env, dt_object_child(dt), buf, pos, th);
}
static int lod_declare_punch(const struct lu_env *env, struct dt_object *dt,
* \param[in] rec record of the index to be inserted
* \param[in] key key of the index to be inserted
* \param[in] th the transaction handle
- * \param[in] ign whether ignore quota
*
* \retval 0 if the insertion succeeds.
* \retval negative errno if the insertion fails.
*/
int lod_sub_insert(const struct lu_env *env, struct dt_object *dt,
const struct dt_rec *rec, const struct dt_key *key,
- struct thandle *th, int ign)
+ struct thandle *th)
{
struct thandle *sub_th;
int rc;
return rc;
}
- return dt_insert(env, dt, rec, key, sub_th, ign);
+ return dt_insert(env, dt, rec, key, sub_th);
}
/**
* \param[in] buf buffer to write which includes an embedded size field
* \param[in] pos offet in the object to start writing at
* \param[in] th transaction handle
- * \param[in] rq enforcement for this write
*
* \retval the buffer size in bytes if it succeeds.
* \retval negative errno if it fails.
*/
ssize_t lod_sub_write(const struct lu_env *env, struct dt_object *dt,
const struct lu_buf *buf, loff_t *pos,
- struct thandle *th, int rq)
+ struct thandle *th)
{
struct thandle *sub_th;
bool record_update;
RETURN(rc);
}
- rc = dt_write(env, dt, buf, pos, sub_th, rq);
+ rc = dt_write(env, dt, buf, pos, sub_th);
RETURN(rc);
}
if (dt_try_as_dir(env, next)) {
struct dt_insert_rec *rec = &mdd_env_info(env)->mti_dt_rec;
- struct lu_ucred *uc = lu_ucred_check(env);
- int ignore_quota;
rec->rec_fid = lf;
rec->rec_type = type;
- ignore_quota = uc ? uc->uc_cap & CFS_CAP_SYS_RESOURCE_MASK : 1;
rc = dt_insert(env, next, (const struct dt_rec *)rec,
- (const struct dt_key *)name, handle,
- ignore_quota);
+ (const struct dt_key *)name, handle);
} else {
rc = -ENOTDIR;
}
#endif
if (S_ISLNK(attr->la_mode)) {
- struct lu_ucred *uc = lu_ucred_assert(env);
struct dt_object *dt = mdd_object_child(son);
const char *target_name = spec->u.sp_symname;
int sym_len = strlen(target_name);
loff_t pos = 0;
buf = mdd_buf_get_const(env, target_name, sym_len);
- rc = dt->do_body_ops->dbo_write(env, dt, buf, &pos, handle,
- uc->uc_cap &
- CFS_CAP_SYS_RESOURCE_MASK);
-
+ rc = dt->do_body_ops->dbo_write(env, dt, buf, &pos, handle);
if (rc == sym_len)
rc = 0;
else
rec->rec_fid = lf;
rec->rec_type = mdd_object_type(obj);
- return dt_insert(env, dor, (const struct dt_rec *)rec, key, th, 1);
+ return dt_insert(env, dor, (const struct dt_rec *)rec, key, th);
}
int mdd_orphan_declare_insert(const struct lu_env *env, struct mdd_object *obj,
rec->rec_fid = lf_dor;
rec->rec_type = S_IFDIR;
dt_insert(env, next, (const struct dt_rec *)rec,
- (const struct dt_key *)dotdot, th, 1);
+ (const struct dt_key *)dotdot, th);
out:
if (rc == 0)
LASSERT(dt->do_body_ops);
LASSERT(dt->do_body_ops->dbo_write);
- size = dt->do_body_ops->dbo_write(env, dt, buf, pos, th, 1);
+ size = dt->do_body_ops->dbo_write(env, dt, buf, pos, th);
if (size < 0)
return size;
return (size == (ssize_t)buf->lb_len) ? 0 : -EFAULT;
(struct dt_key *)name, th);
} else {
rc = dt_insert(env, dir, (struct dt_rec *)rec,
- (struct dt_key *)name, th, 1);
+ (struct dt_key *)name, th);
}
dt_write_unlock(env, dir);
rec->rec_type = S_IFREG;
dt_read_lock(env, llog_dir, 0);
rc = dt_insert(env, llog_dir, (struct dt_rec *)rec,
- (struct dt_key *)res->lgh_name,
- th, 1);
+ (struct dt_key *)res->lgh_name, th);
dt_read_unlock(env, llog_dir);
dt_object_put(env, llog_dir);
if (rc)
rec->rec_fid = fid;
/* Add "." and ".." for newly created dir */
rc = dt_insert(env, dto, (const struct dt_rec *)rec,
- (const struct dt_key *)".", th, 1);
+ (const struct dt_key *)".", th);
if (rc != 0)
GOTO(destroy, rc);
dt_ref_add(env, dto, th);
rec->rec_fid = lu_object_fid(&parent->do_lu);
rc = dt_insert(env, dto, (const struct dt_rec *)rec,
- (const struct dt_key *)"..", th, 1);
+ (const struct dt_key *)"..", th);
if (rc != 0)
GOTO(destroy, rc);
}
rec->rec_type = dto->do_lu.lo_header->loh_attr;
dt_write_lock(env, parent, LOS_PARENT);
rc = dt_insert(env, parent, (const struct dt_rec *)rec,
- (const struct dt_key *)name, th, 1);
+ (const struct dt_key *)name, th);
if (dti->dti_dof.dof_type == DFT_DIR)
dt_ref_add(env, parent, th);
dt_write_unlock(env, parent);
rec->rec_fid = &dti->dti_fid;
rec->rec_type = dto->do_lu.lo_header->loh_attr;
rc = dt_insert(env, parent, (const struct dt_rec *)rec,
- (const struct dt_key *)name, th, 1);
+ (const struct dt_key *)name, th);
GOTO(unlock, rc);
}
GOTO(stop, rc);
rc = dt_insert(env, parent_obj, (const struct dt_rec *)&ent,
- (const struct dt_key *)name, th, 1);
+ (const struct dt_key *)name, th);
dt_trans_stop(env, dev, th);
/* Some index name may has been inserted by OSD
* automatically when create the index object. */
if (rc)
GOTO(stop, rc);
- rc = dt_insert(env, tgt_obj, rec, key, th, 1);
+ rc = dt_insert(env, tgt_obj, rec, key, th);
if (unlikely(rc == -EEXIST))
rc = 0;
*/
static int osd_index_iam_insert(const struct lu_env *env, struct dt_object *dt,
const struct dt_rec *rec,
- const struct dt_key *key, struct thandle *th,
- int ignore_quota)
+ const struct dt_key *key, struct thandle *th)
{
struct osd_object *obj = osd_dt_obj(dt);
struct iam_path_descr *ipd;
*/
static int osd_index_ea_insert(const struct lu_env *env, struct dt_object *dt,
const struct dt_rec *rec,
- const struct dt_key *key, struct thandle *th,
- int ignore_quota)
+ const struct dt_key *key, struct thandle *th)
{
struct osd_object *obj = osd_dt_obj(dt);
struct osd_device *osd = osd_dev(dt->do_lu.lo_dev);
int dr_npages;
int dr_error;
int dr_frags;
- unsigned int dr_ignore_quota:1;
unsigned int dr_elapsed_valid:1; /* we really did count time */
unsigned int dr_rw:1;
struct lu_buf dr_pg_buf;
static ssize_t osd_write(const struct lu_env *env, struct dt_object *dt,
const struct lu_buf *buf, loff_t *pos,
- struct thandle *handle, int ignore_quota)
+ struct thandle *handle)
{
struct inode *inode = osd_dt_obj(dt)->oo_inode;
struct osd_thandle *oh;
* \param key key for index
* \param rec record reference
* \param th transaction handler
- * \param ignore_quota update should not affect quota
*
* \retval 0 success
* \retval -ve failure
*/
static int osd_dir_insert(const struct lu_env *env, struct dt_object *dt,
const struct dt_rec *rec, const struct dt_key *key,
- struct thandle *th, int ignore_quota)
+ struct thandle *th)
{
struct osd_thread_info *oti = osd_oti_get(env);
struct osd_object *parent = osd_dt_obj(dt);
static int osd_index_insert(const struct lu_env *env, struct dt_object *dt,
const struct dt_rec *rec, const struct dt_key *key,
- struct thandle *th, int ignore_quota)
+ struct thandle *th)
{
struct osd_object *obj = osd_dt_obj(dt);
struct osd_device *osd = osd_obj2dev(obj);
static ssize_t osd_write(const struct lu_env *env, struct dt_object *dt,
const struct lu_buf *buf, loff_t *pos,
- struct thandle *th, int ignore_quota)
+ struct thandle *th)
{
struct osd_object *obj = osd_dt_obj(dt);
struct osd_device *osd = osd_obj2dev(obj);
* \param[in] rec record of the index to be inserted
* \param[in] key key of the index to be inserted
* \param[in] th the transaction handle
- * \param[in] ignore_quota quota enforcement for insert
*
* \retval 0 if packing index insert succeeds.
* \retval negative errno if packing fails.
*/
static int osp_md_index_insert(const struct lu_env *env, struct dt_object *dt,
const struct dt_rec *rec,
- const struct dt_key *key, struct thandle *th,
- int ignore_quota)
+ const struct dt_key *key, struct thandle *th)
{
struct osp_update_request *update;
int rc;
* \param[in] buf buffer to write which includes an embedded size field
* \param[in] pos offet in the object to start writing at
* \param[in] th transaction handle
- * \param[in] ignore_quota quota enforcement for this write
*
* \retval the buffer size in bytes if packing succeeds.
* \retval negative errno if packing fails.
*/
static ssize_t osp_md_write(const struct lu_env *env, struct dt_object *dt,
const struct lu_buf *buf, loff_t *pos,
- struct thandle *th, int ignore_quota)
+ struct thandle *th)
{
struct osp_object *obj = dt2osp_obj(dt);
struct osp_update_request *update;
struct dt_object *dt,
const struct dt_rec *rec,
const struct dt_key *key,
- struct thandle *handle,
- int ignore_quota)
+ struct thandle *handle)
{
return -EOPNOTSUPP;
}
dt_write_lock(env, idx, 0);
rc = dt_insert(env, idx, (const struct dt_rec *)nr,
- (const struct dt_key *)nk, th, 1);
+ (const struct dt_key *)nk, th);
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,
- (const struct dt_key *)nk, th, 1);
+ (const struct dt_key *)nk, th);
if (rc != 0)
GOTO(out_lock, rc);
if (rec != NULL) {
/* insert record with updated quota settings */
- rc = dt_insert(env, obj, rec, key, th, 1);
+ rc = dt_insert(env, obj, rec, key, th);
if (rc) {
/* try to insert the old one */
rc = dt_insert(env, obj, (struct dt_rec *)&qti->qti_rec,
- key, th, 1);
+ key, th);
LASSERTF(rc == 0, "failed to insert record in quota "
"index "DFID"\n",
PFID(lu_object_fid(&obj->do_lu)));
rc = 0;
}
- rc = dt_insert(env, obj, (struct dt_rec *)rec, key, th, 1);
+ rc = dt_insert(env, obj, (struct dt_rec *)rec, key, th);
out_lock:
dt_write_unlock(env, obj);
out:
return -ENOTDIR;
dt_write_lock(env, dt_obj, MOR_TGT_CHILD);
- rc = dt_insert(env, dt_obj, rec, key, th, 0);
+ rc = dt_insert(env, dt_obj, rec, key, th);
dt_write_unlock(env, dt_obj);
return rc;