/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2012, Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
{
struct llu_sb_info *sbi = (struct llu_sb_info *) fs->fs_private;
struct obd_device *obd = class_exp2obd(sbi->ll_md_exp);
- struct obd_device *prev = NULL;
+ int next = 0;
ENTRY;
cfs_list_del(&sbi->ll_conn_chain);
obd_disconnect(sbi->ll_dt_exp);
obd_disconnect(sbi->ll_md_exp);
- while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &prev)) != NULL)
+ while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next)) != NULL)
class_manual_cleanup(obd);
OBD_FREE(sbi, sizeof(*sbi));
if (lsm != NULL) {
if (lli->lli_smd == NULL) {
- cl_inode_init(inode, md);
+ cl_file_inode_init(inode, md);
lli->lli_smd = lsm;
lli->lli_maxbytes = lsm->lsm_maxbytes;
- if (lli->lli_maxbytes > PAGE_CACHE_MAXBYTES)
- lli->lli_maxbytes = PAGE_CACHE_MAXBYTES;
+ if (lli->lli_maxbytes > MAX_LFS_FILESIZE)
+ lli->lli_maxbytes = MAX_LFS_FILESIZE;
} else {
if (lov_stripe_md_cmp(lli->lli_smd, lsm)) {
CERROR("lsm mismatch for inode %lld\n",
OBD_MD_FLBLKSZ | OBD_MD_FLMTIME |
OBD_MD_FLCTIME | OBD_MD_FLGROUP |
OBD_MD_FLATIME | OBD_MD_FLEPOCH;
- obdo_from_inode(oinfo.oi_oa, NULL, &llu_i2info(inode)->lli_fid, 0);
+ obdo_set_parent_fid(oinfo.oi_oa, &llu_i2info(inode)->lli_fid);
if (sync) {
oinfo.oi_oa->o_valid |= OBD_MD_FLFLAGS;
oinfo.oi_oa->o_flags |= OBD_FL_SRVLOCK;
OBD_MD_FLSIZE;
obdo_refresh_inode(inode, oinfo.oi_oa, oinfo.oi_oa->o_valid);
- CDEBUG(D_INODE, "objid "LPX64" size %Lu, blocks %Lu, "
- "blksize %Lu\n", lli->lli_smd->lsm_object_id,
+ CDEBUG(D_INODE, "objid "LPX64" size %llu, blocks %llu, "
+ "blksize %llu\n", lli->lli_smd->lsm_object_id,
(long long unsigned)llu_i2stat(inode)->st_size,
(long long unsigned)llu_i2stat(inode)->st_blocks,
(long long unsigned)llu_i2stat(inode)->st_blksize);
struct lustre_md md;
class_uuid_t uuid;
struct config_llog_instance cfg = {0, };
- char ll_instance[sizeof(sbi) * 2 + 3];
struct lustre_profile *lprof;
char *zconf_mgsnid, *zconf_profile;
char *osc = NULL, *mdc = NULL;
int async = 1, err = -EINVAL;
struct obd_connect_data ocd = {0,};
struct md_op_data op_data = {{0}};
+ /* %p for void* in printf needs 16+2 characters: 0xffffffffffffffff */
+ const int instlen = sizeof(cfg.cfg_instance) * 2 + 2;
ENTRY;
/* generate a string unique to this super, let's try
the address of the super itself.*/
- snprintf(ll_instance, sizeof(ll_instance), "%p", sbi);
+ cfg.cfg_instance = sbi;
/* retrive & parse config log */
- cfg.cfg_instance = ll_instance;
cfg.cfg_uuid = sbi->ll_sb_uuid;
err = liblustre_process_log(&cfg, zconf_mgsnid, zconf_profile, 1);
if (err < 0) {
CERROR("No profile found: %s\n", zconf_profile);
GOTO(out_free, err = -EINVAL);
}
- OBD_ALLOC(osc, strlen(lprof->lp_dt) + strlen(ll_instance) + 2);
- sprintf(osc, "%s-%s", lprof->lp_dt, ll_instance);
+ OBD_ALLOC(osc, strlen(lprof->lp_dt) + instlen + 2);
+ sprintf(osc, "%s-%p", lprof->lp_dt, cfg.cfg_instance);
- OBD_ALLOC(mdc, strlen(lprof->lp_md) + strlen(ll_instance) + 2);
- sprintf(mdc, "%s-%s", lprof->lp_md, ll_instance);
+ OBD_ALLOC(mdc, strlen(lprof->lp_md) + instlen + 2);
+ sprintf(mdc, "%s-%p", lprof->lp_md, cfg.cfg_instance);
if (!osc) {
CERROR("no osc\n");
ocd.ocd_connect_flags = OBD_CONNECT_SRVLOCK | OBD_CONNECT_REQPORTAL |
OBD_CONNECT_VERSION | OBD_CONNECT_TRUNCLOCK |
OBD_CONNECT_FID | OBD_CONNECT_AT |
- OBD_CONNECT_FULL20;
+ OBD_CONNECT_FULL20 | OBD_CONNECT_EINPROGRESS;
ocd.ocd_version = LUSTRE_VERSION_CODE;
err = obd_connect(NULL, &sbi->ll_dt_exp, obd, &sbi->ll_sb_uuid, &ocd, NULL);
ptlrpc_req_finished(request);
CDEBUG(D_SUPER, "LibLustre: %s mounted successfully!\n", source);
- liblustre_wait_idle();
-
- return 0;
+ err = 0;
+ goto out_free;
out_inode:
_sysio_i_gone(root);
obd_disconnect(sbi->ll_md_exp);
out_free:
if (osc)
- OBD_FREE(osc, strlen(osc) + 1);
+ OBD_FREE(osc, strlen(lprof->lp_dt) + instlen + 2);
if (mdc)
- OBD_FREE(mdc, strlen(mdc) + 1);
+ OBD_FREE(mdc, strlen(lprof->lp_md) + instlen + 2);
OBD_FREE(sbi, sizeof(*sbi));
liblustre_wait_idle();
return err;