Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754720Ab3IISK3 (ORCPT ); Mon, 9 Sep 2013 14:10:29 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:59882 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754061Ab3IISK2 (ORCPT ); Mon, 9 Sep 2013 14:10:28 -0400 From: Tom Gundersen To: fuse-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org, Tom Gundersen , Kay Sievers , Miklos Szeredi Subject: [PATCH] cuse: creat 'dead' device node for on-demand module loading Date: Mon, 9 Sep 2013 20:11:38 +0200 Message-Id: <1378750298-965-1-git-send-email-teg@jklm.no> X-Mailer: git-send-email 1.8.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1631 Lines: 54 This allows udev (or more recently systemd-tmpfiles) to create /dev/cuse on boot, in the same way as /dev/fuse is currently created, and the corresponding module to be loaded on first access. The corresponding functionalty was introduced for fuse in commit 578454f. Signed-off-by: Tom Gundersen Cc: Kay Sievers Cc: Miklos Szeredi --- fs/fuse/cuse.c | 5 ++++- include/linux/miscdevice.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c index adbfd66..24da581 100644 --- a/fs/fuse/cuse.c +++ b/fs/fuse/cuse.c @@ -589,11 +589,14 @@ static struct attribute *cuse_class_dev_attrs[] = { ATTRIBUTE_GROUPS(cuse_class_dev); static struct miscdevice cuse_miscdev = { - .minor = MISC_DYNAMIC_MINOR, + .minor = CUSE_MINOR, .name = "cuse", .fops = &cuse_channel_fops, }; +MODULE_ALIAS_MISCDEV(CUSE_MINOR); +MODULE_ALIAS("devname:cuse"); + static int __init cuse_init(void) { int i, rc; diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index cb35835..65c8619 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -39,6 +39,7 @@ #define MISC_MCELOG_MINOR 227 #define HPET_MINOR 228 #define FUSE_MINOR 229 +#define CUSE_MINOR 230 #define KVM_MINOR 232 #define BTRFS_MINOR 234 #define AUTOFS_MINOR 235 -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/