}
/**
- * \retval +v: new filter_fid, does not contain self-fid
- * \retval 0: filter_fid_old, contains self-fid
+ * \retval +v: new filter_fid does not contain self-fid
+ * \retval 0: filter_fid_18_23, contains self-fid
* \retval -v: other failure cases
*/
int osd_get_idif(struct osd_thread_info *info, struct inode *inode,
struct dentry *dentry, struct lu_fid *fid)
{
- struct filter_fid_old *ff = &info->oti_ff;
+ struct filter_fid *ff = &info->oti_ff;
struct ost_id *ostid = &info->oti_ostid;
int rc;
rc = __osd_xattr_get(inode, dentry, XATTR_NAME_FID, ff, sizeof(*ff));
- if (rc == sizeof(*ff)) {
- rc = 0;
- ostid_set_seq(ostid, le64_to_cpu(ff->ff_seq));
- rc = ostid_set_id(ostid, le64_to_cpu(ff->ff_objid));
+ if (rc == sizeof(struct filter_fid_18_23)) {
+ struct filter_fid_18_23 *ff_old = (void *)ff;
+
+ ostid_set_seq(ostid, le64_to_cpu(ff_old->ff_seq));
+ rc = ostid_set_id(ostid, le64_to_cpu(ff_old->ff_objid));
/*
* XXX: use 0 as the index for compatibility, the caller will
* handle index related issues when necessary.
*/
if (!rc)
ostid_to_fid(fid, ostid, 0);
- } else if (rc == sizeof(struct filter_fid)) {
+ } else if (rc >= (int)sizeof(struct filter_fid_24_29)) {
rc = 1;
} else if (rc >= 0) {
rc = -EINVAL;
if (rc == -ENODATA && !fid_is_igif(rfid) && osd->od_check_ff) {
fid = &lma->lma_self_fid;
rc = osd_get_idif(info, inode, dentry, fid);
- if ((rc > 0) || (rc == -ENODATA && osd->od_index_in_idif)) {
+ if (rc > 0 || (rc == -ENODATA && osd->od_index_in_idif)) {
/*
* For the given OST-object, if it has neither LMA nor
* FID in XATTR_NAME_FID, then the given FID (which is
struct osd_thandle *oh;
struct osd_iobuf *iobuf = &oti->oti_iobuf;
struct osd_device *osd = osd_dt_dev(th->th_dev);
- struct qsd_instance *qsd = osd->od_quota_slave;
+ struct qsd_instance *qsd = osd_def_qsd(osd);
struct lquota_trans *qtrans;
struct list_head truncates = LIST_HEAD_INIT(truncates);
int rc = 0, remove_agents = 0;
osd_index_fini(obj);
if (inode != NULL) {
- struct qsd_instance *qsd = osd_obj2dev(obj)->od_quota_slave;
- qid_t uid = i_uid_read(inode);
- qid_t gid = i_gid_read(inode);
+ struct qsd_instance *qsd = osd_def_qsd(osd_obj2dev(obj));
+ qid_t uid = i_uid_read(inode);
+ qid_t gid = i_gid_read(inode);
obj->oo_inode = NULL;
iput(inode);
LA_PROJID | LA_FLAGS | LA_NLINK | LA_RDEV |
LA_BLKSIZE | LA_TYPE;
- attr->la_atime = LTIME_S(inode->i_atime);
- attr->la_mtime = LTIME_S(inode->i_mtime);
- attr->la_ctime = LTIME_S(inode->i_ctime);
+ attr->la_atime = inode->i_atime.tv_sec;
+ attr->la_mtime = inode->i_mtime.tv_sec;
+ attr->la_ctime = inode->i_ctime.tv_sec;
attr->la_mode = inode->i_mode;
attr->la_size = i_size_read(inode);
attr->la_blocks = inode->i_blocks;
if (dof->dof_type != DFT_NODE)
attr->la_valid &= ~LA_RDEV;
- if ((valid & LA_ATIME) && (attr->la_atime == LTIME_S(inode->i_atime)))
+ if ((valid & LA_ATIME) && (attr->la_atime == inode->i_atime.tv_sec))
attr->la_valid &= ~LA_ATIME;
- if ((valid & LA_CTIME) && (attr->la_ctime == LTIME_S(inode->i_ctime)))
+ if ((valid & LA_CTIME) && (attr->la_ctime == inode->i_ctime.tv_sec))
attr->la_valid &= ~LA_CTIME;
- if ((valid & LA_MTIME) && (attr->la_mtime == LTIME_S(inode->i_mtime)))
+ if ((valid & LA_MTIME) && (attr->la_mtime == inode->i_mtime.tv_sec))
attr->la_valid &= ~LA_MTIME;
result = osd_quota_transfer(inode, attr);
*/
local->i_gid = current_fsgid();
ldiskfs_set_inode_state(local, LDISKFS_STATE_LUSTRE_NOSCRUB);
+
+ /* e2fsck doesn't like empty symlinks. Store remote FID as symlink.
+ * That gives e2fsck something to look at and be happy, and allows
+ * debugging if we need to determine where this symlink came from.
+ */
+ if (S_ISLNK(type)) {
+ CLASSERT(LDISKFS_N_BLOCKS * 4 >= FID_LEN + 1);
+ rc = snprintf((char *)LDISKFS_I(local)->i_data,
+ LDISKFS_N_BLOCKS * 4, DFID, PFID(fid));
+
+ i_size_write(local, rc);
+ LDISKFS_I(local)->i_disksize = rc;
+ }
unlock_new_inode(local);
/* Agent inode should not have project ID */
ENTRY;
/* shutdown quota slave instance associated with the device */
- if (o->od_quota_slave != NULL) {
- struct qsd_instance *qsd = o->od_quota_slave;
+ if (o->od_quota_slave_md != NULL) {
+ struct qsd_instance *qsd = o->od_quota_slave_md;
- o->od_quota_slave = NULL;
+ o->od_quota_slave_md = NULL;
+ qsd_fini(env, qsd);
+ }
+
+ if (o->od_quota_slave_dt != NULL) {
+ struct qsd_instance *qsd = o->od_quota_slave_dt;
+
+ o->od_quota_slave_dt = NULL;
qsd_fini(env, qsd);
}
LASSERT(l->ld_site->ls_linkage.prev != NULL);
/* initialize quota slave instance */
- o->od_quota_slave = qsd_init(env, o->od_svname, &o->od_dt_dev,
- o->od_proc_entry);
- if (IS_ERR(o->od_quota_slave)) {
- rc = PTR_ERR(o->od_quota_slave);
- o->od_quota_slave = NULL;
+ /* currently it's no need to prepare qsd_instance_md for OST */
+ if (!o->od_is_ost) {
+ o->od_quota_slave_md = qsd_init(env, o->od_svname,
+ &o->od_dt_dev,
+ o->od_proc_entry, true);
+ if (IS_ERR(o->od_quota_slave_md)) {
+ rc = PTR_ERR(o->od_quota_slave_md);
+ o->od_quota_slave_md = NULL;
+ GOTO(out_procfs, rc);
+ }
+ }
+
+ o->od_quota_slave_dt = qsd_init(env, o->od_svname, &o->od_dt_dev,
+ o->od_proc_entry, false);
+
+ if (IS_ERR(o->od_quota_slave_dt)) {
+ if (o->od_quota_slave_md != NULL) {
+ qsd_fini(env, o->od_quota_slave_md);
+ o->od_quota_slave_md = NULL;
+ }
+
+ rc = PTR_ERR(o->od_quota_slave_dt);
+ o->od_quota_slave_dt = NULL;
GOTO(out_procfs, rc);
}
ENTRY;
- if (osd->od_quota_slave == NULL)
+ if (osd->od_quota_slave_md == NULL && osd->od_quota_slave_dt == NULL)
RETURN(0);
/*
* start qsd instance on recovery completion, this notifies the quota
* slave code that we are about to process new requests now
*/
- rc = qsd_start(env, osd->od_quota_slave);
+ rc = qsd_start(env, osd->od_quota_slave_dt);
+ if (rc == 0 && osd->od_quota_slave_md != NULL)
+ rc = qsd_start(env, osd->od_quota_slave_md);
+
RETURN(rc);
}
ENTRY;
- if (osd->od_quota_slave != NULL) {
- /* set up quota slave objects */
- result = qsd_prepare(env, osd->od_quota_slave);
+ if (osd->od_quota_slave_md != NULL) {
+ /* set up quota slave objects for inode */
+ result = qsd_prepare(env, osd->od_quota_slave_md);
if (result != 0)
RETURN(result);
}
+ if (osd->od_quota_slave_dt != NULL) {
+ /* set up quota slave objects for block */
+ result = qsd_prepare(env, osd->od_quota_slave_dt);
+ if (result != 0)
+ RETURN(result);
+ }
+
+
if (lsd->lsd_feature_incompat & OBD_COMPAT_OST) {
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 0, 52, 0)
if (lsd->lsd_feature_rocompat & OBD_ROCOMPAT_IDX_IN_IDIF) {