From patchwork Tue Jun 7 17:27:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Rees X-Patchwork-Id: 858072 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p57HQgVZ007977 for ; Tue, 7 Jun 2011 17:27:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754833Ab1FGR1g (ORCPT ); Tue, 7 Jun 2011 13:27:36 -0400 Received: from int-mailstore01.merit.edu ([207.75.116.232]:53072 "EHLO int-mailstore01.merit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754412Ab1FGR1g (ORCPT ); Tue, 7 Jun 2011 13:27:36 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by int-mailstore01.merit.edu (Postfix) with ESMTP id 2EED03083A6D; Tue, 7 Jun 2011 13:27:36 -0400 (EDT) X-Virus-Scanned: amavisd-new at int-mailstore01.merit.edu Received: from int-mailstore01.merit.edu ([127.0.0.1]) by localhost (int-mailstore01.merit.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dfQA3COHQbR4; Tue, 7 Jun 2011 13:27:35 -0400 (EDT) Received: from merit.edu (host-17.subnet-17.med.umich.edu [141.214.17.17]) by int-mailstore01.merit.edu (Postfix) with ESMTPSA id 9273E305CF58; Tue, 7 Jun 2011 13:27:35 -0400 (EDT) Date: Tue, 7 Jun 2011 13:27:34 -0400 From: Jim Rees To: Benny Halevy Cc: linux-nfs@vger.kernel.org, peter honeyman Subject: [PATCH 15/88] pnfsblock: dm kernel interface Message-ID: <6982c7d89e262c885b459b7dc4a62990ed6c8bbe.1307464382.git.rees@umich.edu> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 07 Jun 2011 17:27:37 +0000 (UTC) From: Fred Isaman We need kernel access to what is currently a user-mode only ioctl interface. Signed-off-by: Fred Isaman Signed-off-by: Benny Halevy --- drivers/md/dm-ioctl.c | 24 ++++++++++++++++++++++++ fs/nfs/blocklayout/blocklayout.h | 4 ++++ 2 files changed, 28 insertions(+), 0 deletions(-) diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 4cacdad..d0d417e 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -713,6 +713,12 @@ static int dev_create(struct dm_ioctl *param, size_t param_size) return 0; } +int dm_dev_create(struct dm_ioctl *param) +{ + return dev_create(param, sizeof(*param)); +} +EXPORT_SYMBOL(dm_dev_create); + /* * Always use UUID for lookups if it's present, otherwise use name or dev. */ @@ -808,6 +814,12 @@ static int dev_remove(struct dm_ioctl *param, size_t param_size) return 0; } +int dm_dev_remove(struct dm_ioctl *param) +{ + return dev_remove(param, sizeof(*param)); +} +EXPORT_SYMBOL(dm_dev_remove); + /* * Check a string doesn't overrun the chunk of * memory we copied from userland. @@ -990,6 +1002,12 @@ static int do_resume(struct dm_ioctl *param) return r; } +int dm_do_resume(struct dm_ioctl *param) +{ + return do_resume(param); +} +EXPORT_SYMBOL(dm_do_resume); + /* * Set or unset the suspension state of a device. * If the device already is in the requested state we just return its status. @@ -1256,6 +1274,12 @@ out: return r; } +int dm_table_load(struct dm_ioctl *param, size_t param_size) +{ + return table_load(param, param_size); +} +EXPORT_SYMBOL(dm_table_load); + static int table_clear(struct dm_ioctl *param, size_t param_size) { struct hash_cell *hc; diff --git a/fs/nfs/blocklayout/blocklayout.h b/fs/nfs/blocklayout/blocklayout.h index 4af6685..2c6e1fe 100644 --- a/fs/nfs/blocklayout/blocklayout.h +++ b/fs/nfs/blocklayout/blocklayout.h @@ -35,8 +35,12 @@ #include #include /* Needed by nfs4_pnfs.h */ #include +#include /* Needed for struct dm_ioctl*/ extern struct class shost_class; /* exported from drivers/scsi/hosts.c */ +extern int dm_dev_create(struct dm_ioctl *param); /* from dm-ioctl.c */ +extern int dm_dev_remove(struct dm_ioctl *param); /* from dm-ioctl.c */ + struct block_mount_id { struct super_block *bm_sb; /* back pointer */