From patchwork Tue Jul 30 17:34:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 2835810 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 29A1B9F4D4 for ; Tue, 30 Jul 2013 17:34:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11394202F0 for ; Tue, 30 Jul 2013 17:34:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D14B2202CC for ; Tue, 30 Jul 2013 17:34:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752002Ab3G3Ret (ORCPT ); Tue, 30 Jul 2013 13:34:49 -0400 Received: from mail-ve0-f182.google.com ([209.85.128.182]:33984 "EHLO mail-ve0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751763Ab3G3Res (ORCPT ); Tue, 30 Jul 2013 13:34:48 -0400 Received: by mail-ve0-f182.google.com with SMTP id m1so3976489ves.27 for ; Tue, 30 Jul 2013 10:34:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=xHXERJ7xwsBHhVtLI8v0GTPKHwUUDHecZ5mWvb6s124=; b=LWqhSfX70CckNCC5SU1pbDbH3BZXxwEUddWz7X4Z5mt7VPrqgGa0+1KUlBsWWj3s4S nwH+FvwOE/cUreG7ppJ3+fhaCTZAHwTce+VssL1PT1MNQhtb4jOdKSVQ/QhHdQ41son7 3Rti3WMvsIU9ntknClavIZUbl/nzYuUKIVR8BZrlMLqwHgH7uZXGSt+co4CTNtjeS7eR WmEWdxknCz6j/2YJZylm8KrLqKIh+aeZZs9haITgHJS9ZsUY+2bkj7TEn4DHhaWOvRmL bVCrM9USd2r7GE80m0UOPO+iQIioqhWX+JegG2CEVtyIpEAfV9W07olNk5nWhNugmebz s3Ig== X-Received: by 10.58.235.69 with SMTP id uk5mr27284233vec.17.1375205687525; Tue, 30 Jul 2013 10:34:47 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-107-015-124-230.nc.res.rr.com. [107.15.124.230]) by mx.google.com with ESMTPSA id lm13sm30723614vec.8.2013.07.30.10.34.46 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Jul 2013 10:34:46 -0700 (PDT) From: Jeff Layton To: Steve French Cc: linux-cifs@vger.kernel.org Subject: [PATCH] cifs: display iocharset= option in /proc/mounts Date: Tue, 30 Jul 2013 13:34:40 -0400 Message-Id: <1375205680-24417-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.8.3.1 X-Gm-Message-State: ALoCoQnNSYsJuf+hQZ+MrWcqSKtY/y5R4L0xM0wA6USbUV7gsNWHB3IxAms0RO1DdOfv5wCiZWGt Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ...but only if it's not the default charset. Signed-off-by: Jeff Layton --- fs/cifs/cifsfs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 85ea98d..d70e551f 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -357,6 +357,18 @@ cifs_show_cache_flavor(struct seq_file *s, struct cifs_sb_info *cifs_sb) seq_printf(s, "loose"); } +static void +cifs_show_nls(struct seq_file *s, struct nls_table *cur) +{ + struct nls_table *def; + + /* Display iocharset= option if it's not default charset */ + def = load_nls_default(); + if (def != cur) + seq_printf(s, ",iocharset=%s", cur->charset); + unload_nls(def); +} + /* * cifs_show_options() is for displaying mount options in /proc/mounts. * Not all settable options are displayed but most of the important @@ -418,6 +430,9 @@ cifs_show_options(struct seq_file *s, struct dentry *root) seq_printf(s, ",file_mode=0%ho,dir_mode=0%ho", cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode); + + cifs_show_nls(s, cifs_sb->local_nls); + if (tcon->seal) seq_printf(s, ",seal"); if (tcon->nocase)