From patchwork Fri Jul 30 09:59:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suresh Jayaraman X-Patchwork-Id: 115441 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6UA0KsF013061 for ; Fri, 30 Jul 2010 10:00:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755753Ab0G3J7p (ORCPT ); Fri, 30 Jul 2010 05:59:45 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36150 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756528Ab0G3J7o (ORCPT ); Fri, 30 Jul 2010 05:59:44 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id D915A8726A; Fri, 30 Jul 2010 11:59:42 +0200 (CEST) Message-ID: <4C52A287.7020904@suse.de> Date: Fri, 30 Jul 2010 15:29:35 +0530 From: Suresh Jayaraman User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 MIME-Version: 1.0 To: "Steve French (smfltc)" Cc: Jeff Layton , linux-cifs@vger.kernel.org Subject: [RFC][PATCH 1/2] cifs: show enabled features in /proc Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 30 Jul 2010 10:00:21 +0000 (UTC) diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 4fce6e6..af5dbf7 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -402,6 +402,7 @@ static const struct file_operations cifs_multiuser_mount_proc_fops; static const struct file_operations cifs_security_flags_proc_fops; static const struct file_operations cifs_experimental_proc_fops; static const struct file_operations cifs_linux_ext_proc_fops; +static const struct file_operations cifs_feat_proc_fops; void cifs_proc_init(void) @@ -428,6 +429,8 @@ cifs_proc_init(void) &cifs_security_flags_proc_fops); proc_create("LookupCacheEnabled", 0, proc_fs_cifs, &cifs_lookup_cache_proc_fops); + proc_create("features", 0, proc_fs_cifs, + &cifs_feat_proc_fops); } void @@ -448,6 +451,7 @@ cifs_proc_clean(void) remove_proc_entry("LinuxExtensionsEnabled", proc_fs_cifs); remove_proc_entry("Experimental", proc_fs_cifs); remove_proc_entry("LookupCacheEnabled", proc_fs_cifs); + remove_proc_entry("features", proc_fs_cifs); remove_proc_entry("fs/cifs", NULL); } @@ -791,6 +795,38 @@ static const struct file_operations cifs_security_flags_proc_fops = { .release = single_release, .write = cifs_security_flags_proc_write, }; + +static int cifs_feat_proc_show(struct seq_file *m, void *v) +{ + seq_printf(m, "# CIFS features enabled\n"); +#ifdef CONFIG_CIFS_DFS_UPCALL + seq_printf(m, "dfs"); + seq_putc(m, ' '); +#endif +#ifdef CONFIG_CIFS_UPCALL + seq_printf(m, "spnego"); + seq_putc(m, ' '); +#endif +#ifdef CONFIG_CIFS_FSCACHE + seq_printf(m, "fsc"); + seq_putc(m, ' '); +#endif + seq_putc(m, '\n'); + return 0; +} + +static int cifs_feat_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, cifs_feat_proc_show, NULL); +} + +static const struct file_operations cifs_feat_proc_fops = { + .owner = THIS_MODULE, + .open = cifs_feat_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; #else inline void cifs_proc_init(void) {