spin_lock(&export->exp_lock);
already_disconnected = export->exp_disconnected;
export->exp_disconnected = 1;
+ /* We hold references of export for uuid hash
+ * and nid_hash and export link at least. So
+ * it is safe to call cfs_hash_del in there. */
+ if (!hlist_unhashed(&export->exp_nid_hash))
+ cfs_hash_del(export->exp_obd->obd_nid_hash,
+ &export->exp_connection->c_peer.nid,
+ &export->exp_nid_hash);
spin_unlock(&export->exp_lock);
/* class_cleanup(), abort_recovery(), and class_fail_export()
CDEBUG(D_IOCTL, "disconnect: cookie %#llx\n",
export->exp_handle.h_cookie);
- if (!hlist_unhashed(&export->exp_nid_hash))
- cfs_hash_del(export->exp_obd->obd_nid_hash,
- &export->exp_connection->c_peer.nid,
- &export->exp_nid_hash);
-
class_export_recovery_cleanup(export);
class_unlink_export(export);
no_disconn:
spin_unlock(&obd->obd_dev_lock);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(cfs_time_seconds(waited));
- if (waited > 5 && IS_PO2(waited)) {
+ if (waited > 5 && is_power_of_2(waited)) {
LCONSOLE_WARN("%s is waiting for obd_unlinked_exports "
"more than %d seconds. "
"The obd refcount = %d. Is it stuck?\n",
EXPORT_SYMBOL(kuc_alloc);
/* Takes pointer to payload area */
-inline void kuc_free(void *p, int payload_len)
+void kuc_free(void *p, int payload_len)
{
struct kuc_hdr *lh = kuc_ptr(p);
OBD_FREE(lh, kuc_len(payload_len));
int obd_mod_rpc_stats_seq_show(struct client_obd *cli,
struct seq_file *seq)
{
- struct timeval now;
unsigned long mod_tot = 0, mod_cum;
+ struct timespec64 now;
int i;
- do_gettimeofday(&now);
+ ktime_get_real_ts64(&now);
spin_lock(&cli->cl_mod_rpcs_lock);
- seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
- now.tv_sec, now.tv_usec);
+ seq_printf(seq, "snapshot_time: %llu.%9lu (secs.nsecs)\n",
+ (s64)now.tv_sec, now.tv_nsec);
seq_printf(seq, "modify_RPCs_in_flight: %hu\n",
cli->cl_mod_rpcs_in_flight);