10 #ifndef ZFCP_REQLIST_H
11 #define ZFCP_REQLIST_H
14 #define ZFCP_REQ_LIST_BUCKETS 128
26 static inline int zfcp_reqlist_hash(
unsigned long req_id)
37 static inline struct zfcp_reqlist *zfcp_reqlist_alloc(
void)
49 INIT_LIST_HEAD(&rl->
buckets[i]);
60 static inline int zfcp_reqlist_isempty(
struct zfcp_reqlist *rl)
65 if (!list_empty(&rl->
buckets[i]))
74 static inline void zfcp_reqlist_free(
struct zfcp_reqlist *rl)
77 BUG_ON(!zfcp_reqlist_isempty(rl));
88 i = zfcp_reqlist_hash(req_id);
90 if (req->req_id == req_id)
110 req = _zfcp_reqlist_find(rl, req_id);
111 spin_unlock_irqrestore(&rl->lock, flags);
129 zfcp_reqlist_find_rm(
struct zfcp_reqlist *rl,
unsigned long req_id)
135 req = _zfcp_reqlist_find(rl, req_id);
138 spin_unlock_irqrestore(&rl->
lock, flags);
153 static inline void zfcp_reqlist_add(
struct zfcp_reqlist *rl,
159 i = zfcp_reqlist_hash(req->
req_id);
163 spin_unlock_irqrestore(&rl->
lock, flags);
171 static inline void zfcp_reqlist_move(
struct zfcp_reqlist *rl,
179 list_splice_init(&rl->
buckets[i], list);
180 spin_unlock_irqrestore(&rl->
lock, flags);