diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_def.h')
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index e45a08d6c98e..55dc402c3aec 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -446,9 +446,7 @@ struct zfcp_qdio { | |||
446 | }; | 446 | }; |
447 | 447 | ||
448 | struct zfcp_adapter { | 448 | struct zfcp_adapter { |
449 | atomic_t refcount; /* reference count */ | 449 | struct kref ref; |
450 | wait_queue_head_t remove_wq; /* can be used to wait for | ||
451 | refcount drop to zero */ | ||
452 | u64 peer_wwnn; /* P2P peer WWNN */ | 450 | u64 peer_wwnn; /* P2P peer WWNN */ |
453 | u64 peer_wwpn; /* P2P peer WWPN */ | 451 | u64 peer_wwpn; /* P2P peer WWPN */ |
454 | u32 peer_d_id; /* P2P peer D_ID */ | 452 | u32 peer_d_id; /* P2P peer D_ID */ |
@@ -501,9 +499,6 @@ struct zfcp_port { | |||
501 | struct device sysfs_device; /* sysfs device */ | 499 | struct device sysfs_device; /* sysfs device */ |
502 | struct fc_rport *rport; /* rport of fc transport class */ | 500 | struct fc_rport *rport; /* rport of fc transport class */ |
503 | struct list_head list; /* list of remote ports */ | 501 | struct list_head list; /* list of remote ports */ |
504 | atomic_t refcount; /* reference count */ | ||
505 | wait_queue_head_t remove_wq; /* can be used to wait for | ||
506 | refcount drop to zero */ | ||
507 | struct zfcp_adapter *adapter; /* adapter used to access port */ | 502 | struct zfcp_adapter *adapter; /* adapter used to access port */ |
508 | struct list_head unit_list; /* head of logical unit list */ | 503 | struct list_head unit_list; /* head of logical unit list */ |
509 | rwlock_t unit_list_lock; /* unit list lock */ | 504 | rwlock_t unit_list_lock; /* unit list lock */ |
@@ -525,9 +520,6 @@ struct zfcp_port { | |||
525 | struct zfcp_unit { | 520 | struct zfcp_unit { |
526 | struct device sysfs_device; /* sysfs device */ | 521 | struct device sysfs_device; /* sysfs device */ |
527 | struct list_head list; /* list of logical units */ | 522 | struct list_head list; /* list of logical units */ |
528 | atomic_t refcount; /* reference count */ | ||
529 | wait_queue_head_t remove_wq; /* can be used to wait for | ||
530 | refcount drop to zero */ | ||
531 | struct zfcp_port *port; /* remote port of unit */ | 523 | struct zfcp_port *port; /* remote port of unit */ |
532 | atomic_t status; /* status of this logical unit */ | 524 | atomic_t status; /* status of this logical unit */ |
533 | u64 fcp_lun; /* own FCP_LUN */ | 525 | u64 fcp_lun; /* own FCP_LUN */ |
@@ -656,47 +648,4 @@ zfcp_reqlist_find_safe(struct zfcp_adapter *adapter, struct zfcp_fsf_req *req) | |||
656 | return NULL; | 648 | return NULL; |
657 | } | 649 | } |
658 | 650 | ||
659 | /* | ||
660 | * functions needed for reference/usage counting | ||
661 | */ | ||
662 | |||
663 | static inline void | ||
664 | zfcp_unit_get(struct zfcp_unit *unit) | ||
665 | { | ||
666 | atomic_inc(&unit->refcount); | ||
667 | } | ||
668 | |||
669 | static inline void | ||
670 | zfcp_unit_put(struct zfcp_unit *unit) | ||
671 | { | ||
672 | if (atomic_dec_return(&unit->refcount) == 0) | ||
673 | wake_up(&unit->remove_wq); | ||
674 | } | ||
675 | |||
676 | static inline void | ||
677 | zfcp_port_get(struct zfcp_port *port) | ||
678 | { | ||
679 | atomic_inc(&port->refcount); | ||
680 | } | ||
681 | |||
682 | static inline void | ||
683 | zfcp_port_put(struct zfcp_port *port) | ||
684 | { | ||
685 | if (atomic_dec_return(&port->refcount) == 0) | ||
686 | wake_up(&port->remove_wq); | ||
687 | } | ||
688 | |||
689 | static inline void | ||
690 | zfcp_adapter_get(struct zfcp_adapter *adapter) | ||
691 | { | ||
692 | atomic_inc(&adapter->refcount); | ||
693 | } | ||
694 | |||
695 | static inline void | ||
696 | zfcp_adapter_put(struct zfcp_adapter *adapter) | ||
697 | { | ||
698 | if (atomic_dec_return(&adapter->refcount) == 0) | ||
699 | wake_up(&adapter->remove_wq); | ||
700 | } | ||
701 | |||
702 | #endif /* ZFCP_DEF_H */ | 651 | #endif /* ZFCP_DEF_H */ |