EXIT;
}
-int ll_md_setattr(struct inode *inode, struct md_op_data *op_data,
+int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
struct md_open_data **mod)
{
struct lustre_md md;
+ struct inode *inode = dentry->d_inode;
struct ll_sb_info *sbi = ll_i2sbi(inode);
struct ptlrpc_request *request = NULL;
int rc;
* Pretend we done everything. */
if (!S_ISREG(inode->i_mode) &&
!S_ISDIR(inode->i_mode))
- rc = inode_setattr(inode, &op_data->op_attr);
+ rc = simple_setattr(dentry, &op_data->op_attr);
} else if (rc != -EPERM && rc != -EACCES && rc != -ETXTBSY) {
CERROR("md_setattr fails: rc = %d\n", rc);
}
* above to avoid invoking vmtruncate, otherwise it is important
* to call vmtruncate in inode_setattr to update inode->i_size
* (bug 6196) */
- rc = inode_setattr(inode, &op_data->op_attr);
+ rc = simple_setattr(dentry, &op_data->op_attr);
/* Extract epoch data if obtained. */
op_data->op_handle = md.body->handle;
* I don't believe it is possible to get e.g. ATTR_MTIME_SET and ATTR_SIZE
* at the same time.
*/
-int ll_setattr_raw(struct inode *inode, struct iattr *attr)
+int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
{
+ struct inode *inode = dentry->d_inode;
struct ll_inode_info *lli = ll_i2info(inode);
struct lov_stripe_md *lsm = lli->lli_smd;
struct md_op_data *op_data = NULL;
(ia_valid & (ATTR_SIZE | ATTR_MTIME | ATTR_MTIME_SET)))
op_data->op_flags = MF_EPOCH_OPEN;
- rc = ll_md_setattr(inode, op_data, &mod);
+ rc = ll_md_setattr(dentry, op_data, &mod);
if (rc)
GOTO(out, rc);
!(attr->ia_valid & ATTR_KILL_SGID))
attr->ia_valid |= ATTR_KILL_SGID;
- return ll_setattr_raw(de->d_inode, attr);
+ return ll_setattr_raw(de, attr);
}
int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
} else {
/* Use old size assignment to avoid
* deadlock bz14138 & bz14326 */
- inode->i_size = body->size;
+ i_size_write(inode, body->size);
lli->lli_flags |= LLIF_MDS_SIZE_LOCK;
}
ldlm_lock_decref(&lockh, mode);
} else {
/* Use old size assignment to avoid
* deadlock bz14138 & bz14326 */
- inode->i_size = body->size;
+ i_size_write(inode, body->size);
CDEBUG(D_VFSTRACE, "inode=%lu, updating i_size %llu\n",
inode->i_ino, (unsigned long long)body->size);
GOTO(out_statfs, rc = -EINVAL);
memcpy(&type, data->ioc_inlbuf1, sizeof(__u32));
- if (type == LL_STATFS_MDC)
+ if (type == LL_STATFS_LMV)
exp = sbi->ll_md_exp;
else if (type == LL_STATFS_LOV)
exp = sbi->ll_dt_exp;
RETURN(0);
}
+
+/**
+ * Get obd name by cmd, and copy out to user space
+ */
+int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg)
+{
+ struct ll_sb_info *sbi = ll_i2sbi(inode);
+ struct obd_device *obd;
+ ENTRY;
+
+ if (cmd == OBD_IOC_GETDTNAME)
+ obd = class_exp2obd(sbi->ll_dt_exp);
+ else if (cmd == OBD_IOC_GETMDNAME)
+ obd = class_exp2obd(sbi->ll_md_exp);
+ else
+ RETURN(-EINVAL);
+
+ if (!obd)
+ RETURN(-ENOENT);
+
+ if (cfs_copy_to_user((void *)arg, obd->obd_name,
+ strlen(obd->obd_name) + 1))
+ RETURN(-EFAULT);
+
+ RETURN(0);
+}