blob: 9122ff5f39c8e91e04631cb6d7ab8572c3887039 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Pierre Ossman70f10482007-07-11 20:04:50 +02002 * linux/drivers/mmc/card/queue.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * Copyright (C) 2003 Russell King, All Rights Reserved.
Pierre Ossman98ac2162006-12-23 20:03:02 +01005 * Copyright 2006-2007 Pierre Ossman
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090012#include <linux/slab.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/module.h>
14#include <linux/blkdev.h>
Rafael J. Wysocki83144182007-07-17 04:03:35 -070015#include <linux/freezer.h>
Christoph Hellwig87598a22006-11-13 20:23:52 +010016#include <linux/kthread.h>
Jens Axboe45711f12007-10-22 21:19:53 +020017#include <linux/scatterlist.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
19#include <linux/mmc/card.h>
20#include <linux/mmc/host.h>
Pierre Ossman98ac2162006-12-23 20:03:02 +010021#include "queue.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
Pierre Ossman98ccf142007-05-12 00:26:16 +020023#define MMC_QUEUE_BOUNCESZ 65536
24
Christoph Hellwig87598a22006-11-13 20:23:52 +010025#define MMC_QUEUE_SUSPENDED (1 << 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
27/*
Pierre Ossman9c9f2d62007-05-16 17:29:21 +020028 * Prepare a MMC request. This just filters out odd stuff.
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 */
30static int mmc_prep_request(struct request_queue *q, struct request *req)
31{
Pierre Ossman9c9f2d62007-05-16 17:29:21 +020032 /*
Adrian Hunterbd788c92010-08-11 14:17:47 -070033 * We only like normal block requests and discards.
Pierre Ossman9c9f2d62007-05-16 17:29:21 +020034 */
Adrian Hunterbd788c92010-08-11 14:17:47 -070035 if (req->cmd_type != REQ_TYPE_FS && !(req->cmd_flags & REQ_DISCARD)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 blk_dump_rq_flags(req, "MMC bad request");
Pierre Ossman9c9f2d62007-05-16 17:29:21 +020037 return BLKPREP_KILL;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 }
39
Pierre Ossman9c9f2d62007-05-16 17:29:21 +020040 req->cmd_flags |= REQ_DONTPREP;
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
Pierre Ossman9c9f2d62007-05-16 17:29:21 +020042 return BLKPREP_OK;
Linus Torvalds1da177e2005-04-16 15:20:36 -070043}
44
45static int mmc_queue_thread(void *d)
46{
47 struct mmc_queue *mq = d;
48 struct request_queue *q = mq->queue;
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
Rafael J. Wysocki83144182007-07-17 04:03:35 -070050 current->flags |= PF_MEMALLOC;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 down(&mq->thread_sem);
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 do {
54 struct request *req = NULL;
55
56 spin_lock_irq(q->queue_lock);
57 set_current_state(TASK_INTERRUPTIBLE);
Jens Axboe7eaceac2011-03-10 08:52:07 +010058 req = blk_fetch_request(q);
Per Forlin97868a22011-07-09 17:12:36 -040059 mq->mqrq_cur->req = req;
Linus Torvalds1da177e2005-04-16 15:20:36 -070060 spin_unlock_irq(q->queue_lock);
61
62 if (!req) {
Vitaly Wool7b30d282006-12-07 20:08:02 +010063 if (kthread_should_stop()) {
64 set_current_state(TASK_RUNNING);
Linus Torvalds1da177e2005-04-16 15:20:36 -070065 break;
Vitaly Wool7b30d282006-12-07 20:08:02 +010066 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070067 up(&mq->thread_sem);
68 schedule();
69 down(&mq->thread_sem);
70 continue;
71 }
72 set_current_state(TASK_RUNNING);
73
74 mq->issue_fn(mq, req);
75 } while (1);
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 up(&mq->thread_sem);
77
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 return 0;
79}
80
81/*
82 * Generic MMC request handler. This is called for any queue on a
83 * particular host. When the host is not busy, we look for a request
84 * on any queue on this host, and attempt to issue it. This may
85 * not be the queue we were asked to process.
86 */
Jens Axboe165125e2007-07-24 09:28:11 +020087static void mmc_request(struct request_queue *q)
Linus Torvalds1da177e2005-04-16 15:20:36 -070088{
89 struct mmc_queue *mq = q->queuedata;
Pierre Ossman89b4e132006-11-14 22:08:16 +010090 struct request *req;
Pierre Ossman89b4e132006-11-14 22:08:16 +010091
92 if (!mq) {
Adrian Hunter5fa83ce2010-01-08 14:43:00 -080093 while ((req = blk_fetch_request(q)) != NULL) {
94 req->cmd_flags |= REQ_QUIET;
Tejun Heo296b2f62009-05-08 11:54:15 +090095 __blk_end_request_all(req, -EIO);
Adrian Hunter5fa83ce2010-01-08 14:43:00 -080096 }
Pierre Ossman89b4e132006-11-14 22:08:16 +010097 return;
98 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070099
Per Forlin97868a22011-07-09 17:12:36 -0400100 if (!mq->mqrq_cur->req)
Christoph Hellwig87598a22006-11-13 20:23:52 +0100101 wake_up_process(mq->thread);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102}
103
Per Forlin97868a22011-07-09 17:12:36 -0400104struct scatterlist *mmc_alloc_sg(int sg_len, int *err)
105{
106 struct scatterlist *sg;
107
108 sg = kmalloc(sizeof(struct scatterlist)*sg_len, GFP_KERNEL);
109 if (!sg)
110 *err = -ENOMEM;
111 else {
112 *err = 0;
113 sg_init_table(sg, sg_len);
114 }
115
116 return sg;
117}
118
Adrian Huntere056a1b2011-06-28 17:16:02 +0300119static void mmc_queue_setup_discard(struct request_queue *q,
120 struct mmc_card *card)
121{
122 unsigned max_discard;
123
124 max_discard = mmc_calc_max_discard(card);
125 if (!max_discard)
126 return;
127
128 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
129 q->limits.max_discard_sectors = max_discard;
130 if (card->erased_byte == 0)
131 q->limits.discard_zeroes_data = 1;
132 q->limits.discard_granularity = card->pref_erase << 9;
133 /* granularity must not be greater than max. discard */
134 if (card->pref_erase > max_discard)
135 q->limits.discard_granularity = 0;
136 if (mmc_can_secure_erase_trim(card))
137 queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, q);
138}
139
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140/**
141 * mmc_init_queue - initialise a queue structure.
142 * @mq: mmc queue
143 * @card: mmc card to attach this queue
144 * @lock: queue lock
Adrian Hunterd09408a2011-06-23 13:40:28 +0300145 * @subname: partition subname
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146 *
147 * Initialise a MMC card request queue.
148 */
Adrian Hunterd09408a2011-06-23 13:40:28 +0300149int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card,
150 spinlock_t *lock, const char *subname)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151{
152 struct mmc_host *host = card->host;
153 u64 limit = BLK_BOUNCE_HIGH;
154 int ret;
Per Forlin97868a22011-07-09 17:12:36 -0400155 struct mmc_queue_req *mqrq_cur = &mq->mqrq[0];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156
Greg Kroah-Hartmanfcaf71f2006-09-12 17:00:10 +0200157 if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask)
158 limit = *mmc_dev(host)->dma_mask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159
160 mq->card = card;
161 mq->queue = blk_init_queue(mmc_request, lock);
162 if (!mq->queue)
163 return -ENOMEM;
164
Per Forlin97868a22011-07-09 17:12:36 -0400165 memset(&mq->mqrq_cur, 0, sizeof(mq->mqrq_cur));
166 mq->mqrq_cur = mqrq_cur;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167 mq->queue->queuedata = mq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168
Pierre Ossman98ccf142007-05-12 00:26:16 +0200169 blk_queue_prep_rq(mq->queue, mmc_prep_request);
Pierre Ossman8dddfe12008-10-14 20:04:46 +0200170 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, mq->queue);
Adrian Huntere056a1b2011-06-28 17:16:02 +0300171 if (mmc_can_erase(card))
172 mmc_queue_setup_discard(mq->queue, card);
Pierre Ossman98ccf142007-05-12 00:26:16 +0200173
174#ifdef CONFIG_MMC_BLOCK_BOUNCE
Martin K. Petersena36274e2010-09-10 01:33:59 -0400175 if (host->max_segs == 1) {
Pierre Ossmanaafabfa2007-08-09 14:28:02 +0200176 unsigned int bouncesz;
177
Pierre Ossman98ccf142007-05-12 00:26:16 +0200178 bouncesz = MMC_QUEUE_BOUNCESZ;
179
180 if (bouncesz > host->max_req_size)
181 bouncesz = host->max_req_size;
182 if (bouncesz > host->max_seg_size)
183 bouncesz = host->max_seg_size;
Pierre Ossmanf3eb0aa2008-08-16 21:34:02 +0200184 if (bouncesz > (host->max_blk_count * 512))
185 bouncesz = host->max_blk_count * 512;
Pierre Ossman98ccf142007-05-12 00:26:16 +0200186
Pierre Ossmanf3eb0aa2008-08-16 21:34:02 +0200187 if (bouncesz > 512) {
Per Forlin97868a22011-07-09 17:12:36 -0400188 mqrq_cur->bounce_buf = kmalloc(bouncesz, GFP_KERNEL);
189 if (!mqrq_cur->bounce_buf) {
Pierre Ossmanf3eb0aa2008-08-16 21:34:02 +0200190 printk(KERN_WARNING "%s: unable to "
Per Forlin97868a22011-07-09 17:12:36 -0400191 "allocate bounce cur buffer\n",
Pierre Ossmanf3eb0aa2008-08-16 21:34:02 +0200192 mmc_card_name(card));
193 }
194 }
195
Per Forlin97868a22011-07-09 17:12:36 -0400196 if (mqrq_cur->bounce_buf) {
Pierre Ossman2ff1fa62008-07-22 14:35:42 +0200197 blk_queue_bounce_limit(mq->queue, BLK_BOUNCE_ANY);
Martin K. Petersen086fa5f2010-02-26 00:20:38 -0500198 blk_queue_max_hw_sectors(mq->queue, bouncesz / 512);
Martin K. Petersen8a783622010-02-26 00:20:39 -0500199 blk_queue_max_segments(mq->queue, bouncesz / 512);
Pierre Ossman98ccf142007-05-12 00:26:16 +0200200 blk_queue_max_segment_size(mq->queue, bouncesz);
201
Per Forlin97868a22011-07-09 17:12:36 -0400202 mqrq_cur->sg = mmc_alloc_sg(1, &ret);
203 if (ret)
Pierre Ossmanaafabfa2007-08-09 14:28:02 +0200204 goto cleanup_queue;
Pierre Ossman98ccf142007-05-12 00:26:16 +0200205
Per Forlin97868a22011-07-09 17:12:36 -0400206 mqrq_cur->bounce_sg =
207 mmc_alloc_sg(bouncesz / 512, &ret);
208 if (ret)
Pierre Ossmanaafabfa2007-08-09 14:28:02 +0200209 goto cleanup_queue;
Per Forlin97868a22011-07-09 17:12:36 -0400210
Pierre Ossman98ccf142007-05-12 00:26:16 +0200211 }
212 }
213#endif
214
Per Forlin97868a22011-07-09 17:12:36 -0400215 if (!mqrq_cur->bounce_buf) {
Pierre Ossman98ccf142007-05-12 00:26:16 +0200216 blk_queue_bounce_limit(mq->queue, limit);
Martin K. Petersen086fa5f2010-02-26 00:20:38 -0500217 blk_queue_max_hw_sectors(mq->queue,
Pierre Ossmanf3eb0aa2008-08-16 21:34:02 +0200218 min(host->max_blk_count, host->max_req_size / 512));
Martin K. Petersena36274e2010-09-10 01:33:59 -0400219 blk_queue_max_segments(mq->queue, host->max_segs);
Pierre Ossman98ccf142007-05-12 00:26:16 +0200220 blk_queue_max_segment_size(mq->queue, host->max_seg_size);
221
Per Forlin97868a22011-07-09 17:12:36 -0400222 mqrq_cur->sg = mmc_alloc_sg(host->max_segs, &ret);
223 if (ret)
Pierre Ossman98ccf142007-05-12 00:26:16 +0200224 goto cleanup_queue;
Per Forlin97868a22011-07-09 17:12:36 -0400225
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226 }
227
Thomas Gleixner632cf922010-09-14 07:12:35 -0400228 sema_init(&mq->thread_sem, 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229
Adrian Hunterd09408a2011-06-23 13:40:28 +0300230 mq->thread = kthread_run(mmc_queue_thread, mq, "mmcqd/%d%s",
231 host->index, subname ? subname : "");
Ethan Dude528fa2010-09-30 18:40:27 -0400232
Christoph Hellwig87598a22006-11-13 20:23:52 +0100233 if (IS_ERR(mq->thread)) {
234 ret = PTR_ERR(mq->thread);
Pierre Ossman98ccf142007-05-12 00:26:16 +0200235 goto free_bounce_sg;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236 }
237
Christoph Hellwig87598a22006-11-13 20:23:52 +0100238 return 0;
Pierre Ossman98ccf142007-05-12 00:26:16 +0200239 free_bounce_sg:
Per Forlin97868a22011-07-09 17:12:36 -0400240 kfree(mqrq_cur->bounce_sg);
241 mqrq_cur->bounce_sg = NULL;
242
Pierre Ossmanaafabfa2007-08-09 14:28:02 +0200243 cleanup_queue:
Per Forlin97868a22011-07-09 17:12:36 -0400244 kfree(mqrq_cur->sg);
245 mqrq_cur->sg = NULL;
246 kfree(mqrq_cur->bounce_buf);
247 mqrq_cur->bounce_buf = NULL;
248
Linus Torvalds1da177e2005-04-16 15:20:36 -0700249 blk_cleanup_queue(mq->queue);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250 return ret;
251}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252
253void mmc_cleanup_queue(struct mmc_queue *mq)
254{
Jens Axboe165125e2007-07-24 09:28:11 +0200255 struct request_queue *q = mq->queue;
Pierre Ossman89b4e132006-11-14 22:08:16 +0100256 unsigned long flags;
Per Forlin97868a22011-07-09 17:12:36 -0400257 struct mmc_queue_req *mqrq_cur = mq->mqrq_cur;
Pierre Ossman89b4e132006-11-14 22:08:16 +0100258
Pierre Ossmand2b46f62007-04-28 16:52:12 +0200259 /* Make sure the queue isn't suspended, as that will deadlock */
260 mmc_queue_resume(mq);
261
Pierre Ossman89b4e132006-11-14 22:08:16 +0100262 /* Then terminate our worker thread */
Christoph Hellwig87598a22006-11-13 20:23:52 +0100263 kthread_stop(mq->thread);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264
Adrian Hunter5fa83ce2010-01-08 14:43:00 -0800265 /* Empty the queue */
266 spin_lock_irqsave(q->queue_lock, flags);
267 q->queuedata = NULL;
268 blk_start_queue(q);
269 spin_unlock_irqrestore(q->queue_lock, flags);
270
Per Forlin97868a22011-07-09 17:12:36 -0400271 kfree(mqrq_cur->bounce_sg);
272 mqrq_cur->bounce_sg = NULL;
Pierre Ossman98ccf142007-05-12 00:26:16 +0200273
Per Forlin97868a22011-07-09 17:12:36 -0400274 kfree(mqrq_cur->sg);
275 mqrq_cur->sg = NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276
Per Forlin97868a22011-07-09 17:12:36 -0400277 kfree(mqrq_cur->bounce_buf);
278 mqrq_cur->bounce_buf = NULL;
Pierre Ossman98ccf142007-05-12 00:26:16 +0200279
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280 mq->card = NULL;
281}
282EXPORT_SYMBOL(mmc_cleanup_queue);
283
284/**
285 * mmc_queue_suspend - suspend a MMC request queue
286 * @mq: MMC queue to suspend
287 *
288 * Stop the block request queue, and wait for our thread to
289 * complete any outstanding requests. This ensures that we
290 * won't suspend while a request is being processed.
291 */
292void mmc_queue_suspend(struct mmc_queue *mq)
293{
Jens Axboe165125e2007-07-24 09:28:11 +0200294 struct request_queue *q = mq->queue;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295 unsigned long flags;
296
297 if (!(mq->flags & MMC_QUEUE_SUSPENDED)) {
298 mq->flags |= MMC_QUEUE_SUSPENDED;
299
300 spin_lock_irqsave(q->queue_lock, flags);
301 blk_stop_queue(q);
302 spin_unlock_irqrestore(q->queue_lock, flags);
303
304 down(&mq->thread_sem);
305 }
306}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307
308/**
309 * mmc_queue_resume - resume a previously suspended MMC request queue
310 * @mq: MMC queue to resume
311 */
312void mmc_queue_resume(struct mmc_queue *mq)
313{
Jens Axboe165125e2007-07-24 09:28:11 +0200314 struct request_queue *q = mq->queue;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315 unsigned long flags;
316
317 if (mq->flags & MMC_QUEUE_SUSPENDED) {
318 mq->flags &= ~MMC_QUEUE_SUSPENDED;
319
320 up(&mq->thread_sem);
321
322 spin_lock_irqsave(q->queue_lock, flags);
323 blk_start_queue(q);
324 spin_unlock_irqrestore(q->queue_lock, flags);
325 }
326}
Pierre Ossman98ac2162006-12-23 20:03:02 +0100327
Pierre Ossman2ff1fa62008-07-22 14:35:42 +0200328/*
329 * Prepare the sg list(s) to be handed of to the host driver
330 */
Per Forlin97868a22011-07-09 17:12:36 -0400331unsigned int mmc_queue_map_sg(struct mmc_queue *mq, struct mmc_queue_req *mqrq)
Pierre Ossman98ccf142007-05-12 00:26:16 +0200332{
333 unsigned int sg_len;
Pierre Ossman2ff1fa62008-07-22 14:35:42 +0200334 size_t buflen;
335 struct scatterlist *sg;
336 int i;
Pierre Ossman98ccf142007-05-12 00:26:16 +0200337
Per Forlin97868a22011-07-09 17:12:36 -0400338 if (!mqrq->bounce_buf)
339 return blk_rq_map_sg(mq->queue, mqrq->req, mqrq->sg);
Pierre Ossman98ccf142007-05-12 00:26:16 +0200340
Per Forlin97868a22011-07-09 17:12:36 -0400341 BUG_ON(!mqrq->bounce_sg);
Pierre Ossman98ccf142007-05-12 00:26:16 +0200342
Per Forlin97868a22011-07-09 17:12:36 -0400343 sg_len = blk_rq_map_sg(mq->queue, mqrq->req, mqrq->bounce_sg);
Pierre Ossman98ccf142007-05-12 00:26:16 +0200344
Per Forlin97868a22011-07-09 17:12:36 -0400345 mqrq->bounce_sg_len = sg_len;
Pierre Ossman98ccf142007-05-12 00:26:16 +0200346
Pierre Ossman2ff1fa62008-07-22 14:35:42 +0200347 buflen = 0;
Per Forlin97868a22011-07-09 17:12:36 -0400348 for_each_sg(mqrq->bounce_sg, sg, sg_len, i)
Pierre Ossman2ff1fa62008-07-22 14:35:42 +0200349 buflen += sg->length;
Pierre Ossman98ccf142007-05-12 00:26:16 +0200350
Per Forlin97868a22011-07-09 17:12:36 -0400351 sg_init_one(mqrq->sg, mqrq->bounce_buf, buflen);
Pierre Ossman98ccf142007-05-12 00:26:16 +0200352
353 return 1;
354}
355
Pierre Ossman2ff1fa62008-07-22 14:35:42 +0200356/*
357 * If writing, bounce the data to the buffer before the request
358 * is sent to the host driver
359 */
Per Forlin97868a22011-07-09 17:12:36 -0400360void mmc_queue_bounce_pre(struct mmc_queue_req *mqrq)
Pierre Ossman98ccf142007-05-12 00:26:16 +0200361{
Per Forlin97868a22011-07-09 17:12:36 -0400362 if (!mqrq->bounce_buf)
Pierre Ossman98ccf142007-05-12 00:26:16 +0200363 return;
364
Per Forlin97868a22011-07-09 17:12:36 -0400365 if (rq_data_dir(mqrq->req) != WRITE)
Pierre Ossman98ccf142007-05-12 00:26:16 +0200366 return;
367
Per Forlin97868a22011-07-09 17:12:36 -0400368 sg_copy_to_buffer(mqrq->bounce_sg, mqrq->bounce_sg_len,
369 mqrq->bounce_buf, mqrq->sg[0].length);
Pierre Ossman98ccf142007-05-12 00:26:16 +0200370}
371
Pierre Ossman2ff1fa62008-07-22 14:35:42 +0200372/*
373 * If reading, bounce the data from the buffer after the request
374 * has been handled by the host driver
375 */
Per Forlin97868a22011-07-09 17:12:36 -0400376void mmc_queue_bounce_post(struct mmc_queue_req *mqrq)
Pierre Ossman98ccf142007-05-12 00:26:16 +0200377{
Per Forlin97868a22011-07-09 17:12:36 -0400378 if (!mqrq->bounce_buf)
Pierre Ossman98ccf142007-05-12 00:26:16 +0200379 return;
380
Per Forlin97868a22011-07-09 17:12:36 -0400381 if (rq_data_dir(mqrq->req) != READ)
Pierre Ossman98ccf142007-05-12 00:26:16 +0200382 return;
383
Per Forlin97868a22011-07-09 17:12:36 -0400384 sg_copy_from_buffer(mqrq->bounce_sg, mqrq->bounce_sg_len,
385 mqrq->bounce_buf, mqrq->sg[0].length);
Pierre Ossman98ccf142007-05-12 00:26:16 +0200386}