From: Artem Bityutskiy Date: Fri, 25 Mar 2011 15:41:20 +0000 (+0200) Subject: Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux... X-Git-Tag: v2.6.39-rc1~40^2 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=7bf7e370d5919112c223a269462cd0b546903829 Merge branch 'master' of git://git./linux/kernel/git/torvalds/linux-2.6 into for-linus-1 * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6: (9356 commits) [media] rc: update for bitop name changes fs: simplify iget & friends fs: pull inode->i_lock up out of writeback_single_inode fs: rename inode_lock to inode_hash_lock fs: move i_wb_list out from under inode_lock fs: move i_sb_list out from under inode_lock fs: remove inode_lock from iput_final and prune_icache fs: Lock the inode LRU list separately fs: factor inode disposal fs: protect inode->i_state with inode->i_lock lib, arch: add filter argument to show_mem and fix private implementations SLUB: Write to per cpu data when allocating it slub: Fix debugobjects with lockless fastpath autofs4: Do not potentially dereference NULL pointer returned by fget() in autofs_dev_ioctl_setpipefd() autofs4 - remove autofs4_lock autofs4 - fix d_manage() return on rcu-walk autofs4 - fix autofs4_expire_indirect() traversal autofs4 - fix dentry leak in autofs4_expire_direct() autofs4 - reinstate last used update on access vfs - check non-mountpoint dentry might block in __follow_mount_rcu() ... NOTE! This merge commit was created to fix compilation error. The block tree was merged upstream and removed the 'elv_queue_empty()' function which the new 'mtdswap' driver is using. So a simple merge of the mtd tree with upstream does not compile. And the mtd tree has already be published, so re-basing it is not an option. To fix this unfortunate situation, I had to merge upstream into the mtd-2.6.git tree without committing, put the fixup patch on top of this, and then commit this. The result is that we do not have commits which do not compile. In other words, this merge commit "merges" 3 things: the MTD tree, the upstream tree, and the fixup patch. --- 7bf7e370d5919112c223a269462cd0b546903829 diff --cc drivers/mtd/mtd_blkdevs.c index 650511304030,e0a2373bf0e2..a534e1f0c348 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@@ -119,15 -119,6 +119,15 @@@ static int do_blktrans_request(struct m } } +int mtd_blktrans_cease_background(struct mtd_blktrans_dev *dev) +{ + if (kthread_should_stop()) + return 1; + - return !elv_queue_empty(dev->rq); ++ return dev->bg_stop; +} +EXPORT_SYMBOL_GPL(mtd_blktrans_cease_background); + static int mtd_blktrans_thread(void *arg) { struct mtd_blktrans_dev *dev = arg; @@@ -141,20 -130,7 +141,21 @@@ while (!kthread_should_stop()) { int res; ++ dev->bg_stop = false; if (!req && !(req = blk_fetch_request(rq))) { + if (tr->background && !background_done) { + spin_unlock_irq(rq->queue_lock); + mutex_lock(&dev->lock); + tr->background(dev); + mutex_unlock(&dev->lock); + spin_lock_irq(rq->queue_lock); + /* + * Do background processing just once per idle + * period. + */ - background_done = 1; ++ background_done = !dev->bg_stop; + continue; + } set_current_state(TASK_INTERRUPTIBLE); if (kthread_should_stop()) @@@ -198,8 -172,8 +199,10 @@@ static void mtd_blktrans_request(struc if (!dev) while ((req = blk_fetch_request(rq)) != NULL) __blk_end_request_all(req, -ENODEV); -- else ++ else { ++ dev->bg_stop = true; wake_up_process(dev->thread); ++ } } static int blktrans_open(struct block_device *bdev, fmode_t mode) diff --cc include/linux/mtd/blktrans.h index 66bec4bf2b0a,26529ebd59cc..1bbd9f289245 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h @@@ -36,6 -36,6 +36,7 @@@ struct mtd_blktrans_dev struct mtd_info *mtd; struct mutex lock; int devnum; ++ bool bg_stop; unsigned long size; int readonly; int open;