scsi: fc: implement kref backed reference counting

Implement kref backed reference counting instead of rolling our own. This
elimnates the need of the following fields in 'struct fc_bsg_job':
* ref_cnt
* state_flags
* job_lock
bringing us close to unification of 'struct fc_bsg_job' and 'struct bsg_job'.

Signed-off-by: Johannes Thumshirn <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
Johannes Thumshirn 2016-11-17 10:31:17 +01:00 • committed by Martin K. Petersen
commit ad7660cc1e
2 changed files with 12 additions and 32 deletions

View file

@ -634,9 +634,7 @@ struct fc_bsg_job {
struct fc_rport *rport;
struct device *dev;
struct request *req;
spinlock_t job_lock;
unsigned int state_flags;
unsigned int ref_cnt;
struct kref kref;
struct fc_bsg_request *request;
struct fc_bsg_reply *reply;