This patch fixes issues reported by checkpatch
for file lustre/osd-zfs/osd_handler.c
Test-Parameters: trivial fstype=zfs
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: Ibf1d954b8c1e3e64d3ae1661cfecbb09569ba955
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54262
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#endif
{
struct osd_device *od = private;
#endif
{
struct osd_device *od = private;
- struct lu_site *site = &od->od_site;
- struct lu_env env;
+ struct lu_site *site = &od->od_site;
+ struct lu_env env;
int rc;
rc = lu_env_init(&env, LCT_SHRINKER);
int rc;
rc = lu_env_init(&env, LCT_SHRINKER);
*/
static void osd_trans_commit_cb(void *cb_data, int error)
{
*/
static void osd_trans_commit_cb(void *cb_data, int error)
{
- struct osd_thandle *oh = cb_data;
- struct thandle *th = &oh->ot_super;
- struct osd_device *osd = osd_dt_dev(th->th_dev);
- struct lu_device *lud = &th->th_dev->dd_lu_dev;
- struct dt_txn_commit_cb *dcb, *tmp;
+ struct osd_thandle *oh = cb_data;
+ struct thandle *th = &oh->ot_super;
+ struct osd_device *osd = osd_dt_dev(th->th_dev);
+ struct lu_device *lud = &th->th_dev->dd_lu_dev;
+ struct dt_txn_commit_cb *dcb, *tmp;
if (error) {
if (error == ECANCELED)
CWARN("%s: transaction @0x%p was aborted\n",
if (error) {
if (error == ECANCELED)
CWARN("%s: transaction @0x%p was aborted\n",
* component that reserved quota space is now accounted in usage and
* should be released. Quota space won't be adjusted at this point since
* we can't provide a suitable environment. It will be performed
* component that reserved quota space is now accounted in usage and
* should be released. Quota space won't be adjusted at this point since
* we can't provide a suitable environment. It will be performed
- * asynchronously by a lquota thread. */
+ * asynchronously by a lquota thread.
+ */
qsd_op_end(NULL, osd->od_quota_slave_dt, &oh->ot_quota_trans);
if (osd->od_quota_slave_md != NULL)
qsd_op_end(NULL, osd->od_quota_slave_md, &oh->ot_quota_trans);
qsd_op_end(NULL, osd->od_quota_slave_dt, &oh->ot_quota_trans);
if (osd->od_quota_slave_md != NULL)
qsd_op_end(NULL, osd->od_quota_slave_md, &oh->ot_quota_trans);
if (CFS_FAIL_CHECK(OBD_FAIL_OSD_TXN_START))
/* Unlike ldiskfs, ZFS checks for available space and returns
if (CFS_FAIL_CHECK(OBD_FAIL_OSD_TXN_START))
/* Unlike ldiskfs, ZFS checks for available space and returns
- * -ENOSPC when assigning txg */
+ * -ENOSPC when assigning txg
+ */
RETURN(-EIO);
rc = -dmu_tx_assign(oh->ot_tx, TXG_WAIT);
if (unlikely(rc != 0)) {
/* dmu will call commit callback with error code during abort */
if (!lu_device_is_md(&d->dd_lu_dev) && rc == -ENOSPC)
RETURN(-EIO);
rc = -dmu_tx_assign(oh->ot_tx, TXG_WAIT);
if (unlikely(rc != 0)) {
/* dmu will call commit callback with error code during abort */
if (!lu_device_is_md(&d->dd_lu_dev) && rc == -ENOSPC)
- CERROR("%s: failed to start transaction due to ENOSPC"
- "\n", osd->od_svname);
+ CERROR("%s: failed to start transaction due to ENOSPC: rc = %d\n",
+ osd->od_svname, rc);
else
CERROR("%s: can't assign tx: rc = %d\n",
osd->od_svname, rc);
else
CERROR("%s: can't assign tx: rc = %d\n",
osd->od_svname, rc);
struct list_head *list, bool free)
{
struct osd_object *obj;
struct list_head *list, bool free)
{
struct osd_object *obj;
while (!list_empty(list)) {
obj = list_first_entry(list,
while (!list_empty(list)) {
obj = list_first_entry(list,
static void osd_trans_stop_cb(struct osd_thandle *oth, int result)
{
static void osd_trans_stop_cb(struct osd_thandle *oth, int result)
{
- struct dt_txn_commit_cb *dcb;
- struct dt_txn_commit_cb *tmp;
+ struct dt_txn_commit_cb *dcb;
+ struct dt_txn_commit_cb *tmp;
/* call per-transaction stop callbacks if any */
list_for_each_entry_safe(dcb, tmp, &oth->ot_stop_dcb_list,
/* call per-transaction stop callbacks if any */
list_for_each_entry_safe(dcb, tmp, &oth->ot_stop_dcb_list,
static int osd_trans_stop(const struct lu_env *env, struct dt_device *dt,
struct thandle *th)
{
static int osd_trans_stop(const struct lu_env *env, struct dt_device *dt,
struct thandle *th)
{
- struct osd_device *osd = osd_dt_dev(th->th_dev);
- bool sync = (th->th_sync != 0);
- struct osd_thandle *oh;
+ struct osd_device *osd = osd_dt_dev(th->th_dev);
+ bool sync = (th->th_sync != 0);
+ struct osd_thandle *oh;
- uint64_t txg;
- int rc;
- ENTRY;
+ uint64_t txg;
+ int rc;
oh = container_of(th, struct osd_thandle, ot_super);
list_splice_init(&oh->ot_unlinked_list, &unlinked);
oh = container_of(th, struct osd_thandle, ot_super);
list_splice_init(&oh->ot_unlinked_list, &unlinked);
osd_object_sa_dirty_rele(env, oh);
osd_unlinked_list_emptify(env, osd, &unlinked, false);
/* there won't be any commit, release reserved quota space now,
osd_object_sa_dirty_rele(env, oh);
osd_unlinked_list_emptify(env, osd, &unlinked, false);
/* there won't be any commit, release reserved quota space now,
qsd_op_end(env, osd->od_quota_slave_dt, &oh->ot_quota_trans);
if (osd->od_quota_slave_md != NULL)
qsd_op_end(env, osd->od_quota_slave_md,
qsd_op_end(env, osd->od_quota_slave_dt, &oh->ot_quota_trans);
if (osd->od_quota_slave_md != NULL)
qsd_op_end(env, osd->od_quota_slave_md,
osd_object_sa_dirty_rele(env, oh);
/* XXX: Once dmu_tx_commit() called, oh/th could have been freed
osd_object_sa_dirty_rele(env, oh);
/* XXX: Once dmu_tx_commit() called, oh/th could have been freed
- * by osd_trans_commit_cb already. */
+ * by osd_trans_commit_cb already.
+ */
dmu_tx_commit(oh->ot_tx);
osd_oti_get(env)->oti_in_trans = 0;
dmu_tx_commit(oh->ot_tx);
osd_oti_get(env)->oti_in_trans = 0;
static struct thandle *osd_trans_create(const struct lu_env *env,
struct dt_device *dt)
{
static struct thandle *osd_trans_create(const struct lu_env *env,
struct dt_device *dt)
{
- struct osd_device *osd = osd_dt_dev(dt);
- struct osd_thandle *oh;
- struct thandle *th;
- dmu_tx_t *tx;
- ENTRY;
+ struct osd_device *osd = osd_dt_dev(dt);
+ struct osd_thandle *oh;
+ struct thandle *th;
+ dmu_tx_t *tx;
+ int rc;
- CERROR("%s: someone try to start transaction under "
- "readonly mode, should be disabled.\n",
- osd_name(osd_dt_dev(dt)));
+ rc = -EROFS;
+ CERROR("%s: someone try to start transaction under readonly mode, should be disabled: rc = %d\n",
+ osd_name(osd_dt_dev(dt)), rc);
- RETURN(ERR_PTR(-EROFS));
}
tx = dmu_tx_create(osd->od_os);
}
tx = dmu_tx_create(osd->od_os);
- if (tx == NULL)
- RETURN(ERR_PTR(-ENOMEM));
+ if (tx == NULL) {
+ rc = -ENOMEM;
+ CDEBUG(D_OTHER, "%s: dmu_tx_create Failed: rc = %d\n",
+ osd_name(osd_dt_dev(dt)), rc);
+ RETURN(ERR_PTR(rc));
+ }
/* alloc callback data */
OBD_ALLOC_PTR(oh);
if (oh == NULL) {
/* alloc callback data */
OBD_ALLOC_PTR(oh);
if (oh == NULL) {
- RETURN(ERR_PTR(-ENOMEM));
+ CDEBUG(D_OTHER, "%s: Allocate memory failed for osd_handle: rc = %d\n",
+ osd_name(osd_dt_dev(dt)), rc);
+ RETURN(ERR_PTR(rc));
* so we can safely use 7 bits to compute a fixed-point
* fraction and est_totobjs can still fit in 64 bits.
*/
* so we can safely use 7 bits to compute a fixed-point
* fraction and est_totobjs can still fit in 64 bits.
*/
- unsigned dn_per_block = (est_usedobjs << 7) / est_usedblocks;
+ unsigned int dn_per_block = (est_usedobjs << 7) /
+ est_usedblocks;
est_totobjs = (nrblocks * dn_per_block) >> 7;
}
est_totobjs = (nrblocks * dn_per_block) >> 7;
}
osfs->os_files = osfs->os_ffree + usedobjs;
/* ZFS XXX: fill in backing dataset FSID/UUID
osfs->os_files = osfs->os_ffree + usedobjs;
/* ZFS XXX: fill in backing dataset FSID/UUID
- memcpy(osfs->os_fsid, .... );*/
+ * memcpy(osfs->os_fsid, .... );
+ */
osfs->os_namelen = MAXNAMELEN;
osfs->os_maxbytes = OBD_OBJECT_EOF;
osfs->os_namelen = MAXNAMELEN;
osfs->os_maxbytes = OBD_OBJECT_EOF;
struct obd_statfs *osfs, struct obd_statfs_info *info)
{
struct osd_device *osd = osd_dt_dev(d);
struct obd_statfs *osfs, struct obd_statfs_info *info)
{
struct osd_device *osd = osd_dt_dev(d);
rc = osd_objset_statfs(osd, osfs);
if (unlikely(rc != 0))
RETURN(rc);
rc = osd_objset_statfs(osd, osfs);
if (unlikely(rc != 0))
RETURN(rc);
int max_blockshift, nr_blkptrshift, bshift;
/* max_blockshift is the log2 of the number of blocks needed to reach
int max_blockshift, nr_blkptrshift, bshift;
/* max_blockshift is the log2 of the number of blocks needed to reach
- * the maximum filesize (that's to say 2^64) */
+ * the maximum filesize (that's to say 2^64)
+ */
bshift = fls64(spa_maxblocksize(dmu_objset_spa(osd->od_os)) - 1);
max_blockshift = DN_MAX_OFFSET_SHIFT - bshift;
/* nr_blkptrshift is the log2 of the number of block pointers that can
bshift = fls64(spa_maxblocksize(dmu_objset_spa(osd->od_os)) - 1);
max_blockshift = DN_MAX_OFFSET_SHIFT - bshift;
/* nr_blkptrshift is the log2 of the number of block pointers that can
- * be stored in an indirect block */
+ * be stored in an indirect block
+ */
BUILD_BUG_ON(DN_MAX_INDBLKSHIFT <= SPA_BLKPTRSHIFT);
nr_blkptrshift = DN_MAX_INDBLKSHIFT - SPA_BLKPTRSHIFT;
/* max_blockshift / nr_blkptrshift is thus the maximum depth of the
* tree. We add +1 for rounding purpose.
* The tree depth times the indirect block size gives us the maximum
BUILD_BUG_ON(DN_MAX_INDBLKSHIFT <= SPA_BLKPTRSHIFT);
nr_blkptrshift = DN_MAX_INDBLKSHIFT - SPA_BLKPTRSHIFT;
/* max_blockshift / nr_blkptrshift is thus the maximum depth of the
* tree. We add +1 for rounding purpose.
* The tree depth times the indirect block size gives us the maximum
- * cost of inserting a block in the tree */
+ * cost of inserting a block in the tree
+ */
return (max_blockshift / nr_blkptrshift + 1) * (1<<DN_MAX_INDBLKSHIFT);
}
return (max_blockshift / nr_blkptrshift + 1) * (1<<DN_MAX_INDBLKSHIFT);
}
/* inodes are dynamically allocated, so we report the per-inode space
* consumption to upper layers. This static value is not really accurate
* and we should use the same logic as in udmu_objset_statfs() to
/* inodes are dynamically allocated, so we report the per-inode space
* consumption to upper layers. This static value is not really accurate
* and we should use the same logic as in udmu_objset_statfs() to
- * estimate the real size consumed by an object */
+ * estimate the real size consumed by an object
+ */
param->ddp_inodespace = OSD_DNODE_EST_COUNT;
/* Although ZFS isn't an extent-based filesystem, the metadata overhead
* (i.e. 7 levels of indirect blocks, see osd_blk_insert_cost()) should
param->ddp_inodespace = OSD_DNODE_EST_COUNT;
/* Although ZFS isn't an extent-based filesystem, the metadata overhead
* (i.e. 7 levels of indirect blocks, see osd_blk_insert_cost()) should
* can fit into a single contiguous indirect block. There would be some
* cases where this crosses indirect blocks, but it also won't have 7
* new levels of indirect blocks in that case either, so it will still
* can fit into a single contiguous indirect block. There would be some
* cases where this crosses indirect blocks, but it also won't have 7
* new levels of indirect blocks in that case either, so it will still
- * have enough reserved space for the extra indirect block */
+ * have enough reserved space for the extra indirect block
+ */
param->ddp_max_extent_blks =
(1 << (DN_MAX_INDBLKSHIFT - SPA_BLKPTRSHIFT));
param->ddp_extent_tax = osd_blk_insert_cost(osd);
/* Preferred RPC size for efficient disk IO. 1MB shows good
* all-around performance for ZFS, but use blocksize (recordsize)
param->ddp_max_extent_blks =
(1 << (DN_MAX_INDBLKSHIFT - SPA_BLKPTRSHIFT));
param->ddp_extent_tax = osd_blk_insert_cost(osd);
/* Preferred RPC size for efficient disk IO. 1MB shows good
* all-around performance for ZFS, but use blocksize (recordsize)
- * by default if larger to avoid read-modify-write. */
+ * by default if larger to avoid read-modify-write.
+ */
if (osd->od_max_blksz > ONE_MB_BRW_SIZE)
param->ddp_brw_size = osd->od_max_blksz;
else
if (osd->od_max_blksz > ONE_MB_BRW_SIZE)
param->ddp_brw_size = osd->od_max_blksz;
else
static int osd_commit_async(const struct lu_env *env, struct dt_device *dev)
{
struct osd_device *osd = osd_dt_dev(dev);
static int osd_commit_async(const struct lu_env *env, struct dt_device *dev)
{
struct osd_device *osd = osd_dt_dev(dev);
- tx_state_t *tx = &dmu_objset_pool(osd->od_os)->dp_tx;
- uint64_t txg;
+ tx_state_t *tx = &dmu_objset_pool(osd->od_os)->dp_tx;
+ uint64_t txg;
mutex_enter(&tx->tx_sync_lock);
txg = tx->tx_open_txg + 1;
mutex_enter(&tx->tx_sync_lock);
txg = tx->tx_open_txg + 1;
*/
static int osd_ro(const struct lu_env *env, struct dt_device *d)
{
*/
static int osd_ro(const struct lu_env *env, struct dt_device *d)
{
- struct osd_device *osd = osd_dt_dev(d);
- ENTRY;
+ struct osd_device *osd = osd_dt_dev(d);
CERROR("%s: *** setting device %s read-only ***\n",
osd->od_svname, LUSTRE_OSD_ZFS_NAME);
osd->od_dev_set_rdonly = 1;
CERROR("%s: *** setting device %s read-only ***\n",
osd->od_svname, LUSTRE_OSD_ZFS_NAME);
osd->od_dev_set_rdonly = 1;
struct dt_device *dev,
struct lquota_id_info *qi)
{
struct dt_device *dev,
struct lquota_id_info *qi)
{
- struct osd_device *osd = osd_dt_dev(dev);
- struct qsd_instance *qsd = NULL;
+ struct osd_device *osd = osd_dt_dev(dev);
+ struct qsd_instance *qsd = NULL;
if (qi->lqi_is_blk)
qsd = osd->od_quota_slave_dt;
else
if (qi->lqi_is_blk)
qsd = osd->od_quota_slave_dt;
else
*/
static void osd_objset_unregister_callbacks(struct osd_device *o)
{
*/
static void osd_objset_unregister_callbacks(struct osd_device *o)
{
- struct dsl_dataset *ds = dmu_objset_ds(o->od_os);
+ struct dsl_dataset *ds = dmu_objset_ds(o->od_os);
(void) dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_XATTR),
osd_xattr_changed_cb, o);
(void) dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_XATTR),
osd_xattr_changed_cb, o);
*/
static int osd_objset_register_callbacks(struct osd_device *o)
{
*/
static int osd_objset_register_callbacks(struct osd_device *o)
{
- struct dsl_dataset *ds = dmu_objset_ds(o->od_os);
- dsl_pool_t *dp = dmu_objset_pool(o->od_os);
- int rc;
+ struct dsl_dataset *ds = dmu_objset_ds(o->od_os);
+ dsl_pool_t *dp = dmu_objset_pool(o->od_os);
+ int rc;
LASSERT(ds);
LASSERT(dp);
LASSERT(ds);
LASSERT(dp);
static int osd_objset_open(struct osd_device *o)
{
static int osd_objset_open(struct osd_device *o)
{
- uint64_t version = ZPL_VERSION;
- uint64_t sa_obj, unlink_obj;
- int rc;
- ENTRY;
+ uint64_t version = ZPL_VERSION;
+ uint64_t sa_obj, unlink_obj;
+ int rc;
rc = -osd_dmu_objset_own(o->od_mntdev, DMU_OST_ZFS,
o->od_dt_dev.dd_rdonly ? B_TRUE : B_FALSE,
B_TRUE, o, &o->od_os);
if (rc) {
rc = -osd_dmu_objset_own(o->od_mntdev, DMU_OST_ZFS,
o->od_dt_dev.dd_rdonly ? B_TRUE : B_FALSE,
B_TRUE, o, &o->od_os);
if (rc) {
- CERROR("%s: can't open %s\n", o->od_svname, o->od_mntdev);
+ CERROR("%s: can't open %s: rc = %d\n", o->od_svname,
+ o->od_mntdev, rc);
o->od_os = NULL;
GOTO(out, rc);
o->od_os = NULL;
GOTO(out, rc);
rc = -zap_lookup(o->od_os, MASTER_NODE_OBJ,
ZPL_VERSION_STR, 8, 1, &version);
if (rc) {
rc = -zap_lookup(o->od_os, MASTER_NODE_OBJ,
ZPL_VERSION_STR, 8, 1, &version);
if (rc) {
- CERROR("%s: Error looking up ZPL VERSION\n", o->od_mntdev);
+ rc = -EIO;
+ CERROR("%s: Error looking up ZPL VERSION: rc = %d\n",
+ o->od_mntdev, rc);
/*
* We can't return ENOENT because that would mean the objset
* didn't exist.
*/
/*
* We can't return ENOENT because that would mean the objset
* didn't exist.
*/
}
rc = -zap_lookup(o->od_os, MASTER_NODE_OBJ,
}
rc = -zap_lookup(o->od_os, MASTER_NODE_OBJ,
if (!dmu_objset_userused_enabled(o->od_os) ||
DMU_USERUSED_DNODE(o->od_os)->dn_type != DMU_OT_USERGROUP_USED ||
DMU_GROUPUSED_DNODE(o->od_os)->dn_type != DMU_OT_USERGROUP_USED) {
if (!dmu_objset_userused_enabled(o->od_os) ||
DMU_USERUSED_DNODE(o->od_os)->dn_type != DMU_OT_USERGROUP_USED ||
DMU_GROUPUSED_DNODE(o->od_os)->dn_type != DMU_OT_USERGROUP_USED) {
- CERROR("%s: Space accounting not supported by this target, "
- "aborting\n", o->od_svname);
- GOTO(out, rc = -ENOTSUPP);
+ rc = -ENOTSUPP;
+ CERROR("%s: Space accounting not supported by this target, aborting: rc = %d\n",
+ o->od_svname, rc);
+ GOTO(out, rc);
}
rc = __osd_obj2dnode(o->od_os, unlink_obj, &o->od_unlinked);
}
rc = __osd_obj2dnode(o->od_os, unlink_obj, &o->od_unlinked);
uint64_t oid)
{
char *key = osd_oti_get(env)->oti_str;
uint64_t oid)
{
char *key = osd_oti_get(env)->oti_str;
dmu_tx_t *tx;
if (osd->od_dt_dev.dd_rdonly) {
dmu_tx_t *tx;
if (osd->od_dt_dev.dd_rdonly) {
- CERROR("%s: someone try to free objects under "
- "readonly mode, should be disabled.\n", osd_name(osd));
+ rc = -EROFS;
+ CERROR("%s: someone try to free objects under readonly mode, should be disabled: rc = %d\n",
+ osd_name(osd), rc);
}
rc = -dmu_free_long_range(osd->od_os, oid, 0, DMU_OBJECT_END);
}
rc = -dmu_free_long_range(osd->od_os, oid, 0, DMU_OBJECT_END);
static void
osd_unlinked_drain(const struct lu_env *env, struct osd_device *osd)
{
static void
osd_unlinked_drain(const struct lu_env *env, struct osd_device *osd)
{
- zap_cursor_t zc;
- zap_attribute_t *za = &osd_oti_get(env)->oti_za;
+ zap_cursor_t zc;
+ zap_attribute_t *za = &osd_oti_get(env)->oti_za;
zap_cursor_init(&zc, osd->od_os, osd->od_unlinked->dn_object);
while (zap_cursor_retrieve(&zc, za) == 0) {
/* If cannot free the object, leave it in the unlinked set,
* until the OSD is mounted again when obd_unlinked_drain()
zap_cursor_init(&zc, osd->od_os, osd->od_unlinked->dn_object);
while (zap_cursor_retrieve(&zc, za) == 0) {
/* If cannot free the object, leave it in the unlinked set,
* until the OSD is mounted again when obd_unlinked_drain()
if (osd_unlinked_object_free(env, osd, za->za_first_integer))
break;
zap_cursor_advance(&zc);
if (osd_unlinked_object_free(env, osd, za->za_first_integer))
break;
zap_cursor_advance(&zc);
if (o->od_os != NULL)
RETURN(0);
if (o->od_os != NULL)
RETURN(0);
}
if (!osd_dmu_userobj_accounting_available(o))
}
if (!osd_dmu_userobj_accounting_available(o))
- CWARN("%s: dnode accounting not enabled: "
- "enable feature@userobj_accounting in pool\n",
+ CWARN("%s: dnode accounting not enabled: enable feature@userobj_accounting in pool\n",
o->od_mntdev);
/* parse mount option "noacl", and enable ACL by default */
o->od_mntdev);
/* parse mount option "noacl", and enable ACL by default */
struct osd_device *o,
struct lustre_cfg *cfg)
{
struct osd_device *o,
struct lustre_cfg *cfg)
{
- struct lu_device *l = osd2lu_dev(o);
- int rc;
+ struct lu_device *l = osd2lu_dev(o);
+ int rc;
/* if the module was re-loaded, env can loose its keys */
rc = lu_env_refill((struct lu_env *) env);
/* if the module was re-loaded, env can loose its keys */
rc = lu_env_refill((struct lu_env *) env);
struct lu_device *d)
{
struct osd_device *o = osd_dev(d);
struct lu_device *d)
{
struct osd_device *o = osd_dev(d);
ENTRY;
osd_index_backup(env, o, false);
ENTRY;
osd_index_backup(env, o, false);
struct lu_device_type *type,
struct lustre_cfg *cfg)
{
struct lu_device_type *type,
struct lustre_cfg *cfg)
{
- struct osd_device *dev;
- struct osd_seq_list *osl;
- int rc;
+ struct osd_device *dev;
+ struct osd_seq_list *osl;
+ int rc;
OBD_ALLOC_PTR(dev);
if (dev == NULL)
OBD_ALLOC_PTR(dev);
if (dev == NULL)
}
static int osd_device_init(const struct lu_env *env, struct lu_device *d,
}
static int osd_device_init(const struct lu_env *env, struct lu_device *d,
- const char *name, struct lu_device *next)
+ const char *name, struct lu_device *next)
- switch(cfg->lcfg_command) {
+ switch (cfg->lcfg_command) {
case LCFG_SETUP:
rc = osd_mount(env, o, cfg);
break;
case LCFG_CLEANUP:
/* For the case LCFG_PRE_CLEANUP is not called in advance,
case LCFG_SETUP:
rc = osd_mount(env, o, cfg);
break;
case LCFG_CLEANUP:
/* For the case LCFG_PRE_CLEANUP is not called in advance,
- * that may happend if hit failure during mount process. */
+ * that may happend if hit failure during mount process.
+ */
osd_index_backup(env, o, false);
rc = osd_shutdown(env, o);
break;
osd_index_backup(env, o, false);
rc = osd_shutdown(env, o);
break;
static int osd_recovery_complete(const struct lu_env *env, struct lu_device *d)
{
static int osd_recovery_complete(const struct lu_env *env, struct lu_device *d)
{
- struct osd_device *osd = osd_dev(d);
- int rc = 0;
- ENTRY;
+ struct osd_device *osd = osd_dev(d);
+ int rc = 0;
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
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 */
+ * slave code that we are about to process new requests now
+ */
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);
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);
struct obd_device *obd, struct obd_uuid *cluuid,
struct obd_connect_data *data, void *localdata)
{
struct obd_device *obd, struct obd_uuid *cluuid,
struct obd_connect_data *data, void *localdata)
{
- struct osd_device *osd = osd_dev(obd->obd_lu_dev);
- struct lustre_handle conn;
- int rc;
- ENTRY;
+ struct osd_device *osd = osd_dev(obd->obd_lu_dev);
+ struct lustre_handle conn;
+ int rc;
CDEBUG(D_CONFIG, "connect #%d\n", atomic_read(&osd->od_connects));
rc = class_connect(&conn, obd, cluuid);
CDEBUG(D_CONFIG, "connect #%d\n", atomic_read(&osd->od_connects));
rc = class_connect(&conn, obd, cluuid);
struct obd_device *obd = exp->exp_obd;
struct osd_device *osd = osd_dev(obd->obd_lu_dev);
int rc, release = 0;
struct obd_device *obd = exp->exp_obd;
struct osd_device *osd = osd_dev(obd->obd_lu_dev);
int rc, release = 0;
/* Only disconnect the underlying layers on the final disconnect. */
release = atomic_dec_and_test(&osd->od_connects);
/* Only disconnect the underlying layers on the final disconnect. */
release = atomic_dec_and_test(&osd->od_connects);
{
struct seq_server_site *ss = osd_seq_site(osd);
int rc = 0;
{
struct seq_server_site *ss = osd_seq_site(osd);
int rc = 0;
if (osd->od_is_ost || osd->od_cl_seq != NULL)
RETURN(0);
if (osd->od_is_ost || osd->od_cl_seq != NULL)
RETURN(0);
static int osd_prepare(const struct lu_env *env, struct lu_device *pdev,
struct lu_device *dev)
{
static int osd_prepare(const struct lu_env *env, struct lu_device *pdev,
struct lu_device *dev)
{
- struct osd_device *osd = osd_dev(dev);
- int rc = 0;
- ENTRY;
+ struct osd_device *osd = osd_dev(dev);
+ int rc = 0;
if (osd->od_quota_slave_md != NULL) {
/* set up quota slave objects */
rc = qsd_prepare(env, osd->od_quota_slave_md);
if (osd->od_quota_slave_md != NULL) {
/* set up quota slave objects */
rc = qsd_prepare(env, osd->od_quota_slave_md);