Remove redundant ptlrpc_fail_export() function, use class_fail_export().
Move EXPORT_SYMBOL functions to where the function is defined, for clarity.
Move lov_merge_* declarations to a header (same as b_cray).
Fix some compile warnings for liblustre.
b=5921
void ptlrpc_deactivate_import(struct obd_import *imp);
void ptlrpc_invalidate_import(struct obd_import *imp);
void ptlrpc_fail_import(struct obd_import *imp, int generation);
-void ptlrpc_fail_export(struct obd_export *exp);
#endif
struct oig_callback_context *occ, int rc);
void oig_release(struct obd_io_group *oig);
int oig_wait(struct obd_io_group *oig);
+/* ping evictor */
+#ifdef __KERNEL__
+void ping_evictor_start(void);
+void ping_evictor_stop(void);
+#else
+#define ping_evictor_start() do {} while (0)
+#define ping_evictor_stop() do {} while (0)
+#endif
+
/* buf should be len PTL_NALFMT_SIZE */
char *obd_export_nid2str(struct obd_export *exp, char *buf);
struct obd_uuid cfg_uuid;
ptl_nid_t cfg_local_nid;
};
-int class_config_parse_llog(struct llog_ctxt *ctxt, char *name,
+int class_config_parse_llog(struct llog_ctxt *ctxt, char *name,
struct config_llog_instance *cfg);
-int class_config_dump_llog(struct llog_ctxt *ctxt, char *name,
+int class_config_dump_llog(struct llog_ctxt *ctxt, char *name,
struct config_llog_instance *cfg);
struct lustre_profile {
int class_connect(struct lustre_handle *conn, struct obd_device *obd,
struct obd_uuid *cluuid);
int class_disconnect(struct obd_export *exp);
+void class_fail_export(struct obd_export *exp);
void class_disconnect_exports(struct obd_device *obddev);
void class_disconnect_stale_exports(struct obd_device *obddev);
/* generic operations shared by various OBD types */
int obdo_cmp_md(struct obdo *dst, struct obdo *src, obd_flag compare);
void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj);
-/* ping evictor */
-void ping_evictor_start(void);
-void ping_evictor_stop(void);
-
#define OBT(dev) (dev)->obd_type
#define OBP(dev, op) (dev)->obd_type->typ_ops->o_ ## op
{
int rc;
ENTRY;
-
+
OBD_CHECK_OP(obd, process_config, -EOPNOTSUPP);
OBD_COUNTER_INCREMENT(obd, process_config);
-
+
rc = OBP(obd, process_config)(obd, datalen, data);
RETURN(rc);
}
RETURN(rc);
}
-static inline int obd_setattr_async(struct obd_export *exp,
+static inline int obd_setattr_async(struct obd_export *exp,
struct obdo *obdo,
struct lov_stripe_md *ea,
struct obd_trans_info *oti)
{
int rc;
ENTRY;
-
+
EXP_CHECK_OP(exp, setattr_async);
OBD_COUNTER_INCREMENT(exp->exp_obd, setattr_async);
-
+
rc = OBP(exp->exp_obd, setattr_async)(exp, obdo, ea, oti);
RETURN(rc);
}
}
static inline int obd_sync(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *ea, obd_size start,
+ struct lov_stripe_md *ea, obd_size start,
obd_size end)
{
int rc;
RETURN(rc);
}
-static inline int obd_prep_async_page(struct obd_export *exp,
+static inline int obd_prep_async_page(struct obd_export *exp,
struct lov_stripe_md *lsm,
- struct lov_oinfo *loi,
- struct page *page, obd_off offset,
- struct obd_async_page_ops *ops,
+ struct lov_oinfo *loi,
+ struct page *page, obd_off offset,
+ struct obd_async_page_ops *ops,
void *data, void **res)
{
int ret;
OBD_CHECK_OP(exp->exp_obd, set_async_flags, -EOPNOTSUPP);
OBD_COUNTER_INCREMENT(exp->exp_obd, set_async_flags);
- rc = OBP(exp->exp_obd, set_async_flags)(exp, lsm, loi, cookie,
+ rc = OBP(exp->exp_obd, set_async_flags)(exp, lsm, loi, cookie,
async_flags);
RETURN(rc);
}
-static inline int obd_queue_group_io(struct obd_export *exp,
- struct lov_stripe_md *lsm,
- struct lov_oinfo *loi,
- struct obd_io_group *oig,
- void *cookie, int cmd, obd_off off,
+static inline int obd_queue_group_io(struct obd_export *exp,
+ struct lov_stripe_md *lsm,
+ struct lov_oinfo *loi,
+ struct obd_io_group *oig,
+ void *cookie, int cmd, obd_off off,
int count, obd_flag brw_flags,
obd_flag async_flags)
{
OBD_COUNTER_INCREMENT(exp->exp_obd, queue_group_io);
LASSERT(cmd & OBD_BRW_RWMASK);
- rc = OBP(exp->exp_obd, queue_group_io)(exp, lsm, loi, oig, cookie,
+ rc = OBP(exp->exp_obd, queue_group_io)(exp, lsm, loi, oig, cookie,
cmd, off, count, brw_flags,
async_flags);
RETURN(rc);
}
-static inline int obd_trigger_group_io(struct obd_export *exp,
- struct lov_stripe_md *lsm,
+static inline int obd_trigger_group_io(struct obd_export *exp,
+ struct lov_stripe_md *lsm,
struct lov_oinfo *loi,
struct obd_io_group *oig)
{
RETURN(rc);
}
+/* b1_4_bug5047 has changes to make this an obd_merge_lvb() method */
+__u64 lov_merge_size(struct lov_stripe_md *lsm, int kms_only);
+__u64 lov_merge_blocks(struct lov_stripe_md *lsm);
+__u64 lov_merge_mtime(struct lov_stripe_md *lsm, __u64 current_time);
+
static inline int obd_adjust_kms(struct obd_export *exp,
struct lov_stripe_md *lsm, obd_off size,
int shrink)
}
static inline int obd_change_cbdata(struct obd_export *exp,
- struct lov_stripe_md *lsm,
+ struct lov_stripe_md *lsm,
ldlm_iterator_t it, void *data)
{
int rc;
rc = OBP(exp->exp_obd, quotacheck)(exp, oqctl);
RETURN(rc);
-}
+}
static inline int obd_quotactl(struct obd_export *exp,
struct obd_quotactl *oqctl)
rc = OBP(exp->exp_obd, quotactl)(exp, oqctl);
RETURN(rc);
-}
+}
static inline int obd_register_observer(struct obd_device *obd,
export = class_export_get(lock->l_export);
spin_unlock_bh(&waiting_locks_spinlock);
- ptlrpc_fail_export(export);
+ class_fail_export(export);
class_export_put(export);
spin_lock_bh(&waiting_locks_spinlock);
}
if (obd_dump_on_timeout)
portals_debug_dumplog();
- ptlrpc_fail_export(lock->l_export);
+ class_fail_export(lock->l_export);
}
static int ldlm_handle_ast_error(struct ldlm_lock *lock,
valid &= src->o_valid;
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
- CDEBUG(D_INODE, "valid %x, cur time %lu/%lu, new %lu/%lu\n",
- src->o_valid, LTIME_S(st->st_mtime),
+ CDEBUG(D_INODE,"valid "LPX64", cur time %lu/%lu, new %lu/%lu\n",
+ src->o_valid, LTIME_S(st->st_mtime),
LTIME_S(st->st_ctime),
(long)src->o_mtime, (long)src->o_ctime);
valid &= src->o_valid;
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
- CDEBUG(D_INODE, "valid %x, cur time %lu/%lu, new %lu/%lu\n",
- src->o_valid,
+ CDEBUG(D_INODE,"valid "LPX64", cur time %lu/%lu, new %lu/%lu\n",
+ src->o_valid,
LTIME_S(st->st_mtime), LTIME_S(st->st_ctime),
(long)src->o_mtime, (long)src->o_ctime);
{
struct llu_inode_info *lli = llu_i2info(ino);
long flags;
- struct flock *flock;
- long err;
switch (cmd) {
case F_GETFL:
*rtn = 0;
return 0;
#if 0
- case F_GETLK:
- flock = va_arg(ap, struct flock *);
- err = llu_fcntl_getlk(ino, flock);
- *rtn = err? -1: 0;
+ case F_GETLK: {
+ struct flock *flock = va_arg(ap, struct flock *);
+ int err = llu_fcntl_getlk(ino, flock);
+ *rtn = err ? -1: 0;
+
return err;
+ }
case F_SETLK:
- case F_SETLKW:
- flock = va_arg(ap, struct flock *);
- err = llu_fcntl_setlk(ino, cmd, flock);
- *rtn = err? -1: 0;
+ case F_SETLKW: {
+ struct flock *flock = va_arg(ap, struct flock *);
+ int err = llu_fcntl_setlk(ino, cmd, flock);
+ *rtn = err ? -1: 0;
+
return err;
+ }
#endif
}
static int llu_iop_ioctl(struct inode *ino, unsigned long int request,
va_list ap)
{
- unsigned long arg;
liblustre_wait_event(0);
switch (request) {
#if 0
+ unsigned long arg;
case LL_IOC_GROUP_LOCK:
arg = va_arg(ap, unsigned long);
return llu_get_grouplock(ino, arg);
if ((md->body->valid &
(OBD_MD_FLGENER | OBD_MD_FLID | OBD_MD_FLTYPE)) !=
(OBD_MD_FLGENER | OBD_MD_FLID | OBD_MD_FLTYPE)) {
- CERROR("bad md body valid mask 0x%x\n", md->body->valid);
+ CERROR("bad md body valid mask "LPX64"\n", md->body->valid);
LBUG();
return ERR_PTR(-EPERM);
}
return rc;
}
-__u64 lov_merge_size(struct lov_stripe_md *lsm, int kms);
-__u64 lov_merge_blocks(struct lov_stripe_md *lsm);
-__u64 lov_merge_mtime(struct lov_stripe_md *lsm, __u64 current_time);
-
/* NB: lov_merge_size will prefer locally cached writes if they extend the
* file (because it prefers KMS over RSS when larger) */
int ll_glimpse_size(struct inode *inode)
struct inode *lt_inode;
};
-__u64 lov_merge_size(struct lov_stripe_md *lsm, int kms);
int lt_get_mmap_locks(struct ll_lock_tree *tree,
unsigned long addr, size_t count);
req->rq_export->exp_client_uuid.uuid,
req->rq_export->exp_connection->c_remote_uuid.uuid);
- ptlrpc_fail_export(req->rq_export);
+ class_fail_export(req->rq_export);
EXIT;
abort_bulk:
data->ioc_plen1);
if (err)
GOTO(out, err);
-
+
OBD_ALLOC(lcfg, data->ioc_plen1);
err = copy_from_user(lcfg, data->ioc_pbuf1, data->ioc_plen1);
if (err)
#endif
EXPORT_SYMBOL(obd_dev);
-EXPORT_SYMBOL(obdo_cachep);
-EXPORT_SYMBOL(qunit_cachep);
-EXPORT_SYMBOL(qunit_hash_lock);
-EXPORT_SYMBOL(qunit_hash);
EXPORT_SYMBOL(obd_fail_loc);
EXPORT_SYMBOL(ll_set_rdonly);
EXPORT_SYMBOL(ll_clear_rdonly);
EXPORT_SYMBOL(class_find_client_obd);
EXPORT_SYMBOL(class_find_client_notype);
EXPORT_SYMBOL(class_devices_in_group);
-EXPORT_SYMBOL(__class_export_put);
-EXPORT_SYMBOL(class_new_export);
-EXPORT_SYMBOL(class_unlink_export);
-EXPORT_SYMBOL(class_import_get);
-EXPORT_SYMBOL(class_import_put);
-EXPORT_SYMBOL(class_new_import);
-EXPORT_SYMBOL(class_destroy_import);
-EXPORT_SYMBOL(class_connect);
EXPORT_SYMBOL(class_conn2export);
EXPORT_SYMBOL(class_exp2obd);
EXPORT_SYMBOL(class_conn2obd);
EXPORT_SYMBOL(class_exp2cliimp);
EXPORT_SYMBOL(class_conn2cliimp);
EXPORT_SYMBOL(class_disconnect);
-EXPORT_SYMBOL(class_disconnect_exports);
-EXPORT_SYMBOL(class_disconnect_stale_exports);
-EXPORT_SYMBOL(class_update_export_timer);
-
-EXPORT_SYMBOL(oig_init);
-EXPORT_SYMBOL(oig_release);
-EXPORT_SYMBOL(oig_add_one);
-EXPORT_SYMBOL(oig_wait);
-EXPORT_SYMBOL(oig_complete_one);
-
-EXPORT_SYMBOL(ping_evictor_start);
-EXPORT_SYMBOL(ping_evictor_stop);
/* uuid.c */
EXPORT_SYMBOL(class_uuid_unparse);
extern struct list_head obd_types;
static spinlock_t obd_types_lock = SPIN_LOCK_UNLOCKED;
+
kmem_cache_t *obdo_cachep = NULL;
+EXPORT_SYMBOL(obdo_cachep);
kmem_cache_t *import_cachep = NULL;
kmem_cache_t *qunit_cachep = NULL;
struct list_head qunit_hash[NR_DQHASH];
spinlock_t qunit_hash_lock = SPIN_LOCK_UNLOCKED;
+EXPORT_SYMBOL(qunit_cachep);
+EXPORT_SYMBOL(qunit_hash);
+EXPORT_SYMBOL(qunit_hash_lock);
+
int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c);
void (*ptlrpc_abort_inflight_superhack)(struct obd_import *imp);
class_decref(obd);
}
}
+EXPORT_SYMBOL(__class_export_put);
/* Creates a new export, adds it to the hash table, and returns a
* pointer to it. The refcount is 2: one for the hash reference, and
obd_init_export(export);
return export;
}
+EXPORT_SYMBOL(class_new_export);
void class_unlink_export(struct obd_export *exp)
{
class_export_put(exp);
}
+EXPORT_SYMBOL(class_unlink_export);
/* Import management functions */
static void import_handle_addref(void *import)
atomic_read(&import->imp_refcount));
return import;
}
+EXPORT_SYMBOL(class_import_get);
void class_import_put(struct obd_import *import)
{
OBD_FREE(import, sizeof(*import));
EXIT;
}
+EXPORT_SYMBOL(class_import_put);
struct obd_import *class_new_import(void)
{
return imp;
}
+EXPORT_SYMBOL(class_new_import);
void class_destroy_import(struct obd_import *import)
{
class_import_put(import);
}
+EXPORT_SYMBOL(class_destroy_import);
/* A connection defines an export context in which preallocation can
be managed. This releases the export pointer reference, and returns
cluuid->uuid, conn->cookie);
RETURN(0);
}
+EXPORT_SYMBOL(class_connect);
/* This function removes two references from the export: one for the
* hash entry and one for the export pointer passed in. The export
export->exp_disconnected = 1;
spin_unlock(&export->exp_lock);
- /* class_cleanup, abort_recovery, ptlrpc_fail_export, and
- ping_evictor_fail_export all end up in here, and if any of them
- race we shouldn't call extra class_export_puts. */
- if (already_disconnected)
+ /* class_cleanup(), abort_recovery(), and class_fail_export()
+ * all end up in here, and if any of them race we shouldn't
+ * call extra class_export_puts(). */
+ if (already_disconnected)
RETURN(0);
CDEBUG(D_IOCTL, "disconnect: cookie "LPX64"\n",
RETURN(0);
}
-static void class_disconnect_export_list(struct list_head *list, int flags)
+static void class_disconnect_export_list(struct list_head *list, int flags)
{
int rc;
struct lustre_handle fake_conn;
class_disconnect_export_list(&work_list, get_exp_flags_from_obd(obd));
EXIT;
}
+EXPORT_SYMBOL(class_disconnect_exports);
/* Remove exports that have not completed recovery.
*/
class_disconnect_export_list(&work_list, get_exp_flags_from_obd(obd));
EXIT;
}
+EXPORT_SYMBOL(class_disconnect_stale_exports);
int oig_init(struct obd_io_group **oig_out)
{
*oig_out = oig;
RETURN(0);
};
+EXPORT_SYMBOL(oig_init);
static inline void oig_grab(struct obd_io_group *oig)
{
atomic_inc(&oig->oig_refcount);
}
+
void oig_release(struct obd_io_group *oig)
{
if (atomic_dec_and_test(&oig->oig_refcount))
OBD_FREE(oig, sizeof(*oig));
}
+EXPORT_SYMBOL(oig_release);
void oig_add_one(struct obd_io_group *oig,
struct oig_callback_context *occ)
spin_unlock_irqrestore(&oig->oig_lock, flags);
oig_grab(oig);
}
+EXPORT_SYMBOL(oig_add_one);
void oig_complete_one(struct obd_io_group *oig,
struct oig_callback_context *occ, int rc)
wake_up(wake);
oig_release(oig);
}
+EXPORT_SYMBOL(oig_complete_one);
static int oig_done(struct obd_io_group *oig)
{
CDEBUG(D_CACHE, "done waiting on oig %p rc %d\n", oig, oig->oig_rc);
return oig->oig_rc;
}
-
+EXPORT_SYMBOL(oig_wait);
/* Ping evictor thread */
+#define D_PET D_HA
+
+#ifdef __KERNEL__
#define PET_READY 1
#define PET_TERMINATE 2
-#define D_PET D_HA
static int pet_refcount = 0;
static int pet_state;
static int ping_evictor_wake(struct obd_export *exp)
{
-#ifdef __KERNEL__
spin_lock(&pet_lock);
if (pet_exp) {
/* eventually the new obd will call here again. */
export in particular; we just need one to keep the obd. */
class_export_get(pet_exp);
wake_up(&pet_waitq);
-#endif
return 0;
}
-#ifdef __KERNEL__
-/* Same as ptlrpc_fail_export, but this module must load first... */
-void ping_evictor_fail_export(struct obd_export *exp)
+void class_fail_export(struct obd_export *exp)
{
int rc, already_failed;
unsigned long flags;
-
+
spin_lock_irqsave(&exp->exp_lock, flags);
already_failed = exp->exp_failed;
exp->exp_failed = 1;
return;
}
- CDEBUG(D_PET, "disconnecting export %p/%s\n",
+ CDEBUG(D_HA, "disconnecting export %p/%s\n",
exp, exp->exp_client_uuid.uuid);
+ if (obd_dump_on_timeout)
+ portals_debug_dumplog();
+
/* Most callers into obd_disconnect are removing their own reference
* (request, for example) in addition to the one from the hash table.
* We don't have such a reference here, so make one. */
rc = obd_disconnect(exp);
if (rc)
CERROR("disconnecting export %p failed: %d\n", exp, rc);
- CERROR("disconnected export %p/%s\n",
- exp, exp->exp_client_uuid.uuid);
+ else
+ CDEBUG(D_HA, "disconnected export %p/%s\n",
+ exp, exp->exp_client_uuid.uuid);
}
+EXPORT_SYMBOL(class_fail_export);
static int ping_evictor_main(void *arg)
{
"and I am evicting it.\n",
obd->obd_name,
obd_export_nid2str(exp, ipbuf),
- (long)(CURRENT_SECONDS -
- exp->exp_last_request_time));
-
- ping_evictor_fail_export(exp);
+ (long)(CURRENT_SECONDS -
+ exp->exp_last_request_time));
+
+ class_fail_export(exp);
} else {
/* List is sorted, so everyone below is ok */
stop++;
RETURN(0);
}
-#endif
void ping_evictor_start(void)
{
-#ifdef __KERNEL__
int rc;
if (++pet_refcount > 1)
pet_refcount--;
CERROR("Cannot start ping evictor thread: %d\n", rc);
}
-#endif
}
+EXPORT_SYMBOL(ping_evictor_start);
void ping_evictor_stop(void)
{
-#ifdef __KERNEL__
if (--pet_refcount > 0)
return;
pet_state = PET_TERMINATE;
wake_up(&pet_waitq);
-#endif
}
+EXPORT_SYMBOL(ping_evictor_stop);
+#else /* !__KERNEL__ */
+#define ping_evictor_wake(exp) 1
+#endif
/* This function makes sure dead exports are evicted in a timely manner.
This function is only called when some export receives a message (i.e.,
list_move_tail(&exp->exp_obd_chain_timed,
&exp->exp_obd->obd_exports_timed);
+
oldest_exp = list_entry(exp->exp_obd->obd_exports_timed.next,
struct obd_export, exp_obd_chain_timed);
oldest_time = oldest_exp->exp_last_request_time;
EXIT;
}
+EXPORT_SYMBOL(class_update_export_timer);
char *obd_export_nid2str(struct obd_export *exp, char *ipbuf)
{
struct ptlrpc_peer *peer;
-
- peer = exp->exp_connection
- ? &exp->exp_connection->c_peer
- : NULL;
-
+
+ peer = exp->exp_connection ? &exp->exp_connection->c_peer : NULL;
+
if (peer && peer->peer_ni) {
portals_nid2str(peer->peer_ni->pni_number,
peer->peer_id.nid,
int lprocfs_rd_uuid(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
- struct obd_device *dev = (struct obd_device*)data;
+ struct obd_device *obd = (struct obd_device*)data;
- LASSERT(dev != NULL);
+ LASSERT(obd != NULL);
*eof = 1;
- return snprintf(page, count, "%s\n", dev->obd_uuid.uuid);
+ return snprintf(page, count, "%s\n", obd->obd_uuid.uuid);
}
int lprocfs_rd_name(char *page, char **start, off_t off, int count,
req->rq_export->exp_client_uuid.uuid,
req->rq_export->exp_connection->c_remote_uuid.uuid,
req->rq_peerstr);
- ptlrpc_fail_export(req->rq_export);
+ class_fail_export(req->rq_export);
} else {
CERROR("ignoring bulk IO comms error: "
"client reconnected %s@%s id %s\n",
req->rq_export->exp_client_uuid.uuid,
req->rq_export->exp_connection->c_remote_uuid.uuid,
req->rq_peerstr);
- ptlrpc_fail_export(req->rq_export);
+ class_fail_export(req->rq_export);
} else {
CERROR("ignoring bulk IO comms error: "
"client reconnected %s@%s id %s\n",
CERROR("can't disconnect %s: no export found\n", doomed.uuid);
} else {
CERROR("evicting %s at adminstrative request\n", doomed.uuid);
- ptlrpc_fail_export(doomed_exp);
+ class_fail_export(doomed_exp);
class_export_put(doomed_exp);
}
return count;
EXPORT_SYMBOL(ptlrpc_deactivate_import);
EXPORT_SYMBOL(ptlrpc_invalidate_import);
EXPORT_SYMBOL(ptlrpc_fail_import);
-EXPORT_SYMBOL(ptlrpc_fail_export);
EXPORT_SYMBOL(ptlrpc_recover_import);
/* pinger.c */
RETURN(rc);
}
-
-void ptlrpc_fail_export(struct obd_export *exp)
-{
- int rc, already_failed;
- unsigned long flags;
-
- spin_lock_irqsave(&exp->exp_lock, flags);
- already_failed = exp->exp_failed;
- exp->exp_failed = 1;
- spin_unlock_irqrestore(&exp->exp_lock, flags);
-
- if (already_failed) {
- CDEBUG(D_HA, "disconnecting dead export %p/%s; skipping\n",
- exp, exp->exp_client_uuid.uuid);
- return;
- }
-
- CDEBUG(D_HA, "disconnecting export %p/%s\n",
- exp, exp->exp_client_uuid.uuid);
-
- if (obd_dump_on_timeout)
- portals_debug_dumplog();
-
- /* Most callers into obd_disconnect are removing their own reference
- * (request, for example) in addition to the one from the hash table.
- * We don't have such a reference here, so make one. */
- class_export_get(exp);
- rc = obd_disconnect(exp);
- if (rc)
- CERROR("disconnecting export %p failed: %d\n", exp, rc);
-}
__u32 *obdgens;
max_ost_count = (OBD_MAX_IOCTL_BUFFER - size_round(sizeof(data)) -
- size_round(sizeof(desc))) /
+ size_round(sizeof(desc))) /
(sizeof(*uuidp) + sizeof(*obdgens));
if (max_ost_count > *ost_count)
max_ost_count = *ost_count;
char buf[1024];
FILE *fp;
int rc = 0, index;
-
+
param->got_uuids = 1;
/* Get the lov name */
rc = ioctl(dirfd(dir), OBD_IOC_GETNAME, (void *)uuid);
if (rc) {
- fprintf(stderr, "error: can't get lov name: %s\n",
+ fprintf(stderr, "error: can't get lov name: %s\n",
strerror(rc = errno));
return rc;
}
/* Now get the ost uuids from /proc */
- snprintf(buf, sizeof(buf), "/proc/fs/lustre/lov/%s/target_obd",
+ snprintf(buf, sizeof(buf), "/proc/fs/lustre/lov/%s/target_obd",
uuid);
fp = fopen(buf, "r");
if (fp == NULL) {
- fprintf(stderr, "error: %s opening %s\n",
+ fprintf(stderr, "error: %s opening %s\n",
strerror(rc = errno), buf);
return rc;
}
while (fgets(buf, sizeof(buf), fp) != NULL) {
if (sscanf(buf, "%d: %s", &index, uuid) < 2)
break;
-
+
if (param->obduuid) {
if (strncmp(param->obduuid->uuid, uuid,
sizeof(uuid)) == 0) {
}
fclose(fp);
-
+
if (param->obduuid && (param->obdindex == OBD_NOT_FOUND)) {
printf("unknown obduuid: %s\n", param->obduuid->uuid);
rc = EINVAL;
}
-
+
return (rc);
-}
+}
void lov_dump_user_lmm_v1(struct lov_user_md_v1 *lum, char *dname, char *fname,
int obdindex, int quiet, int header, int body)