aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/kcopyd.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2007-07-12 12:26:32 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 18:01:08 -0400
commit028867ac28e51afc834a5931e7545c022557eded (patch)
tree0a268776ac68f26c86a28416b35a60ab54e3fb94 /drivers/md/kcopyd.c
parent79e15ae424afa0a40b1a0c4478046d6ba0b71e20 (diff)
dm: use kmem_cache macro
Use new KMEM_CACHE() macro and make the newly-exposed structure names more meaningful. Also remove some superfluous casts and inlines (let a modern compiler be the judge). Acked-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md/kcopyd.c')
-rw-r--r--drivers/md/kcopyd.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c
index dbc234e3c69f..7e052378c47e 100644
--- a/drivers/md/kcopyd.c
+++ b/drivers/md/kcopyd.c
@@ -29,7 +29,7 @@
29static struct workqueue_struct *_kcopyd_wq; 29static struct workqueue_struct *_kcopyd_wq;
30static struct work_struct _kcopyd_work; 30static struct work_struct _kcopyd_work;
31 31
32static inline void wake(void) 32static void wake(void)
33{ 33{
34 queue_work(_kcopyd_wq, &_kcopyd_work); 34 queue_work(_kcopyd_wq, &_kcopyd_work);
35} 35}
@@ -226,10 +226,7 @@ static LIST_HEAD(_pages_jobs);
226 226
227static int jobs_init(void) 227static int jobs_init(void)
228{ 228{
229 _job_cache = kmem_cache_create("kcopyd-jobs", 229 _job_cache = KMEM_CACHE(kcopyd_job, 0);
230 sizeof(struct kcopyd_job),
231 __alignof__(struct kcopyd_job),
232 0, NULL, NULL);
233 if (!_job_cache) 230 if (!_job_cache)
234 return -ENOMEM; 231 return -ENOMEM;
235 232
@@ -258,7 +255,7 @@ static void jobs_exit(void)
258 * Functions to push and pop a job onto the head of a given job 255 * Functions to push and pop a job onto the head of a given job
259 * list. 256 * list.
260 */ 257 */
261static inline struct kcopyd_job *pop(struct list_head *jobs) 258static struct kcopyd_job *pop(struct list_head *jobs)
262{ 259{
263 struct kcopyd_job *job = NULL; 260 struct kcopyd_job *job = NULL;
264 unsigned long flags; 261 unsigned long flags;
@@ -274,7 +271,7 @@ static inline struct kcopyd_job *pop(struct list_head *jobs)
274 return job; 271 return job;
275} 272}
276 273
277static inline void push(struct list_head *jobs, struct kcopyd_job *job) 274static void push(struct list_head *jobs, struct kcopyd_job *job)
278{ 275{
279 unsigned long flags; 276 unsigned long flags;
280 277