From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756609AbcIUJwJ (ORCPT ); Wed, 21 Sep 2016 05:52:09 -0400 Received: from mail.sigma-star.at ([95.130.255.111]:45996 "EHLO mail.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755050AbcIUJwH (ORCPT ); Wed, 21 Sep 2016 05:52:07 -0400 From: Daniel Walter To: linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org, computersforpeace@gmail.com, dwmw2@infradead.org, boris.brezillon@free-electrons.com, Richard Weinberger Subject: [PATCH v2 24/46] mtd: nandsim: Wire up NANDSIM_MODE_CACHEFILE ioctl mode Date: Wed, 21 Sep 2016 11:51:57 +0200 Message-Id: <37e36b3fc2c97ae93d729c07a260dfb020facce2.1474450296.git.dwalter@sigma-star.at> X-Mailer: git-send-email 2.8.3 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Weinberger Allow the userspace control tool also to setup a cache file. In contrast to the cache_file module parameter the ioctl() only accepts a fd. So, userspace should hand in an fd pointing to a temp file. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 56a2904..0e8574e 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c @@ -2536,10 +2536,15 @@ static int ns_ctrl_new_instance(struct ns_new_instance_req *req) case NANDSIM_BACKEND_RAM: nsparam->bops = &ns_ram_bops; break; + case NANDSIM_BACKEND_FILE: nsparam->bops = &ns_file_bops; break; + case NANDSIM_BACKEND_CACHEFILE: + nsparam->bops = &ns_cachefile_bops; + break; + default: kfree(nsparam); return -EINVAL; -- 2.8.3