#define log2(n) ffz(~(n))
#endif
-static struct super_block * ll_read_super(struct super_block *sb,
- void *data, int silent)
+static struct super_block *ll_read_super(struct super_block *sb,
+ void *data, int silent)
{
struct inode *root = 0;
struct obd_device *obd;
class_uuid_t uuid;
ENTRY;
- MOD_INC_USE_COUNT;
OBD_ALLOC(sbi, sizeof(*sbi));
- if (!sbi) {
- MOD_DEC_USE_COUNT;
+ if (!sbi)
RETURN(NULL);
- }
INIT_LIST_HEAD(&sbi->ll_conn_chain);
INIT_LIST_HEAD(&sbi->ll_orphan_dentry_list);
out_free:
OBD_FREE(sbi, sizeof(*sbi));
- MOD_DEC_USE_COUNT;
goto out_dev;
} /* ll_read_super */
OBD_FREE(sbi, sizeof(*sbi));
- MOD_DEC_USE_COUNT;
EXIT;
} /* ll_put_super */
}
}
- if (atomic_read(&inode->i_count) == 0) {
- char *symlink_name = lli->lli_symlink_name;
+ if (atomic_read(&inode->i_count) != 0)
+ CERROR("clearing in-use inode %lu: count = %d\n",
+ inode->i_ino, atomic_read(&inode->i_count));
- if (lli->lli_smd)
- obd_free_memmd(&sbi->ll_osc_conn, &lli->lli_smd);
+ if (lli->lli_smd)
+ obd_free_memmd(&sbi->ll_osc_conn, &lli->lli_smd);
- if (symlink_name) {
- OBD_FREE(symlink_name, strlen(symlink_name) + 1);
- lli->lli_symlink_name = NULL;
- }
+ if (lli->lli_symlink_name) {
+ OBD_FREE(lli->lli_symlink_name,strlen(lli->lli_symlink_name)+1);
+ lli->lli_symlink_name = NULL;
}
EXIT;
struct obdo *oa;
struct lov_stripe_md *lsm = ll_i2info(inode)->lli_smd;
+ /* mcreate with no open */
if (!lsm)
- GOTO(out, -EINVAL);
+ GOTO(out, 0);
if (lsm->lsm_object_id == 0) {
CERROR("This really happens\n");
GOTO(out, -ENOMEM);
oa->o_id = lsm->lsm_object_id;
- oa->o_mode = inode->i_mode;
- oa->o_valid = OBD_MD_FLID | OBD_MD_FLEASIZE | OBD_MD_FLTYPE;
+ obdo_from_inode(oa, inode, OBD_MD_FLID | OBD_MD_FLTYPE);
err = obd_destroy(ll_i2obdconn(inode), oa, lsm);
obdo_free(oa);
- CDEBUG(D_SUPER, "obd destroy of objid "LPX64" error %d\n",
- lsm->lsm_object_id, err);
+ if (err)
+ CDEBUG(D_SUPER, "obd destroy objid "LPX64" error %d\n",
+ lsm->lsm_object_id, err);
}
out:
clear_inode(inode);
{
struct ptlrpc_request *request = NULL;
struct ll_sb_info *sbi = ll_i2sbi(inode);
- int err;
-
+ int err = 0;
ENTRY;
/* change incore inode */
ll_attr2inode(inode, attr, do_trunc);
- err = mdc_setattr(&sbi->ll_mdc_conn, inode, attr, &request);
- if (err)
- CERROR("mdc_setattr fails (%d)\n", err);
+ /* Don't send size changes to MDS to avoid "fast EA" problems, and
+ * also avoid a pointless RPC (we get file size from OST anyways).
+ */
+ attr->ia_valid &= ~ATTR_SIZE;
+ if (attr->ia_valid) {
+ err = mdc_setattr(&sbi->ll_mdc_conn, inode, attr, &request);
+ if (err)
+ CERROR("mdc_setattr fails (%d)\n", err);
- ptlrpc_req_finished(request);
+ ptlrpc_req_finished(request);
+ }
RETURN(err);
}
/* core attributes first */
ll_update_inode(inode, body);
- //if (body->valid & OBD_MD_FLEASIZE)
LASSERT(!lli->lli_smd);
if (lic && lic->lic_lmm)
obd_unpackmd(ll_i2obdconn(inode), &lli->lli_smd, lic->lic_lmm);
rc = ll_file_size(inode, lli->lli_smd);
if (rc) {
CERROR("ll_file_size: %d\n", rc);
- /* FIXME: need to somehow prevent inode creation */
- LBUG();
+ ll_clear_inode(inode);
make_bad_inode(inode);
}
}
list_for_each_safe(tmp, n, req_list) {
struct ptlrpc_request *req =
list_entry(tmp, struct ptlrpc_request, rq_list);
- CERROR("invalidating req xid "LPD64" op %d to %s:%d\n",
- (unsigned long long)req->rq_xid, req->rq_reqmsg->opc,
+ CERROR("invalidating req xid "LPU64" op %d to %s:%d\n",
+ req->rq_xid, req->rq_reqmsg->opc,
req->rq_connection->c_remote_uuid,
req->rq_import->imp_client->cli_request_portal);
req->rq_flags |= PTL_RPC_FL_ERR;
umount_begin: ll_umount_begin
};
-struct file_system_type lustre_lite_fs_type = {
- "lustre_lite", 0, ll_read_super, NULL
+static struct file_system_type lustre_lite_fs_type = {
+ name: "lustre_lite",
+ fs_flags: 0,
+ read_super: ll_read_super,
+ owner: THIS_MODULE,
};
static int __init init_lustre_lite(void)