lprocfs_exp_setup() now takes 'struct lnet_nid *' as peer_nid.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: If779893d8b1c7b650d39182c121c1f611d058f0d
Reviewed-on: https://review.whamcloud.com/44642
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
extern int lprocfs_add_clear_entry(struct obd_device *obd,
struct proc_dir_entry *entry);
#ifdef HAVE_SERVER_SUPPORT
-extern int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *peer_nid);
+extern int lprocfs_exp_setup(struct obd_export *exp, struct lnet_nid *peer_nid);
extern int lprocfs_exp_cleanup(struct obd_export *exp);
struct dentry *ldebugfs_add_symlink(const char *name, const char *target,
const char *format, ...);
static inline
int lprocfs_nid_stats_clear_seq_show(struct seq_file *m, void *data)
{return 0;}
-static inline int lprocfs_exp_setup(struct obd_export *exp,lnet_nid_t *peer_nid)
+static inline int lprocfs_exp_setup(struct obd_export *exp,
+ struct lnet_nid *peer_nid)
{ return 0; }
#endif
static inline int lprocfs_exp_cleanup(struct obd_export *exp)
int mdt_export_stats_init(struct obd_device *obd, struct obd_export *exp,
void *localdata)
{
- lnet_nid_t *client_nid = localdata;
+ lnet_nid_t *client_nid4 = localdata;
struct nid_stat *stats;
int rc;
ENTRY;
- rc = lprocfs_exp_setup(exp, client_nid);
+ if (client_nid4) {
+ struct lnet_nid client_nid;
+
+ lnet_nid4_to_nid(*client_nid4, &client_nid);
+ rc = lprocfs_exp_setup(exp, &client_nid);
+ } else
+ rc = lprocfs_exp_setup(exp, NULL);
if (rc != 0)
/* Mask error for already created /proc entries */
RETURN(rc == -EALREADY ? 0 : rc);
int mgs_export_stats_init(struct obd_device *obd, struct obd_export *exp,
void *localdata)
{
- lnet_nid_t *client_nid = localdata;
+ lnet_nid_t *client_nid4 = localdata;
struct nid_stat *stats;
int rc;
ENTRY;
- rc = lprocfs_exp_setup(exp, client_nid);
+ if (client_nid4) {
+ struct lnet_nid client_nid;
+
+ lnet_nid4_to_nid(*client_nid4, &client_nid);
+ rc = lprocfs_exp_setup(exp, &client_nid);
+ } else
+ rc = lprocfs_exp_setup(exp, NULL);
if (rc != 0)
/* Mask error for already created /proc entries */
RETURN(rc == -EALREADY ? 0 : rc);
}
EXPORT_SYMBOL(lprocfs_nid_stats_clear_seq_write);
-int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid)
+int lprocfs_exp_setup(struct obd_export *exp, struct lnet_nid *nid)
{
struct nid_stat *new_stat, *old_stat;
struct obd_device *obd = NULL;
/* not test against zero because eric say:
* You may only test nid against another nid, or LNET_NID_ANY.
* Anything else is nonsense.*/
- if (nid == NULL || *nid == LNET_NID_ANY)
+ if (nid == NULL || LNET_NID_IS_ANY(nid))
RETURN(-EALREADY);
- libcfs_nid2str_r(*nid, nidstr, sizeof(nidstr));
+ libcfs_nidstr_r(nid, nidstr, sizeof(nidstr));
spin_lock(&exp->exp_lock);
if (exp->exp_nid_stats != NULL) {
if (new_stat == NULL)
RETURN(-ENOMEM);
- lnet_nid4_to_nid(*nid, &new_stat->nid);
+ new_stat->nid = *nid;
new_stat->nid_obd = exp->exp_obd;
/* we need set default refcount to 1 to balance obd_disconnect */
atomic_set(&new_stat->nid_exp_ref_count, 1);
*/
static int ofd_export_stats_init(struct ofd_device *ofd,
struct obd_export *exp,
- lnet_nid_t *client_nid)
+ lnet_nid_t *client_nid4)
{
struct obd_device *obd = ofd_obd(ofd);
struct nid_stat *stats;
/* Self-export gets no proc entry */
RETURN(0);
- rc = lprocfs_exp_setup(exp, client_nid);
+ if (client_nid4) {
+ struct lnet_nid client_nid;
+
+ lnet_nid4_to_nid(*client_nid4, &client_nid);
+ rc = lprocfs_exp_setup(exp, &client_nid);
+ } else
+ rc = lprocfs_exp_setup(exp, NULL);
if (rc != 0)
/* Mask error for already created /proc entries */
RETURN(rc == -EALREADY ? 0 : rc);