From patchwork Tue Sep 16 20:51:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 4920691 Return-Path: X-Original-To: patchwork-ocfs2-devel@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 921AC9F349 for ; Tue, 16 Sep 2014 21:20:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F51920158 for ; Tue, 16 Sep 2014 21:22:09 +0000 (UTC) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 441DA200F4 for ; Tue, 16 Sep 2014 21:22:08 +0000 (UTC) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s8GLLn5v019300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 16 Sep 2014 21:21:50 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8GLLixc015052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Sep 2014 21:21:45 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1XU0C0-0005Z5-FQ; Tue, 16 Sep 2014 14:21:44 -0700 Received: from acsinet22.oracle.com ([141.146.126.238]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1XTzjO-0004WW-3Y for ocfs2-devel@oss.oracle.com; Tue, 16 Sep 2014 13:52:10 -0700 Received: from aserp1030.oracle.com (aserp1030.oracle.com [141.146.126.68]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8GKq8IY022903 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Sep 2014 20:52:08 GMT Received: from userp2040.oracle.com (userp2040.oracle.com [156.151.31.90]) by aserp1030.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s8GKq765018337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 16 Sep 2014 20:52:08 GMT Authentication-Results: aserp1030.oracle.com; dkim=pass reason="1024-bit key" header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b=JPUwW1iy Received: from pps.filterd (userp2040.oracle.com [127.0.0.1]) by userp2040.oracle.com (8.14.7/8.14.7) with SMTP id s8GKoWlk000530 for ; Tue, 16 Sep 2014 20:52:07 GMT Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) by userp2040.oracle.com with ESMTP id 1pen9fy0j6-1 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 16 Sep 2014 20:52:07 +0000 Received: by mail-la0-f48.google.com with SMTP id ty20so611183lab.35 for ; Tue, 16 Sep 2014 13:52:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1LjQWfu/SAw8R2iHCOz3rUZjUTpzA8PHVRTCuvucB/8=; b=HffsOeapYuMXkWtzIqGFf1MxtaDrw58PPlL7FKZKMWejbBfXa15PngbCnUqeg0NEto 2vbVA6hpt2EWwVZSUQzvw+Ac/N1xuiGOIYgJsPkFCo40Tg642rJrB5OepXz4u2xA58fB NQgC4zNS+1wa/ohWYekj2Kr6gem6eHUcxHYpVQX6LvuNIa6EBe3Szv3HcRvLks0kKu/J Lk9ncLHkVLzW/h344E57fes6B++nofCoddsGQ2HZJrC/iepEczmYclY5nhubLzZsxuaK GZ/0XjCRfPPsQI2NPXeXhCbpiMUw3Y6JmrFBGp8BUKIpCCit99GOvvbxNuSiMPrPKouN K2Sg== X-Gm-Message-State: ALoCoQkOWX78Lp5N1h5RaU0vHjVuMk17MeFUoJIHtH1CIoNV+ki7AxgS7i19i0avYJ3tsLm+Dvk1 X-Received: by 10.152.45.42 with SMTP id j10mr14507574lam.91.1410900722923; Tue, 16 Sep 2014 13:52:02 -0700 (PDT) Received: from spencer.imf.au.dk ([130.225.20.51]) by mx.google.com with ESMTPSA id nb7sm5514091lbb.43.2014.09.16.13.52.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Sep 2014 13:52:02 -0700 (PDT) From: Rasmus Villemoes To: Andrew Morton Date: Tue, 16 Sep 2014 22:51:20 +0200 Message-Id: <1410900696-6481-7-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1410900696-6481-1-git-send-email-linux@rasmusvillemoes.dk> References: <1410900696-6481-1-git-send-email-linux@rasmusvillemoes.dk> X-ServerName: mail-la0-f48.google.com X-Proofpoint-Virus-Version: vendor=nai engine=5600 definitions=7563 signatures=670521 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409160171 X-Mailman-Approved-At: Tue, 16 Sep 2014 14:21:42 -0700 Cc: Mark Fasheh , Rasmus Villemoes , linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH 06/22] ocfs2: Replace strnicmp with strncasecmp X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The kernel used to contain two functions for length-delimited, case-insensitive string comparison, strnicmp with correct semantics and a slightly buggy strncasecmp. The latter is the POSIX name, so strnicmp was renamed to strncasecmp, and strnicmp made into a wrapper for the new strncasecmp to avoid breaking existing users. To allow the compat wrapper strnicmp to be removed at some point in the future, and to avoid the extra indirection cost, do s/strnicmp/strncasecmp/g. Cc: Mark Fasheh Cc: Joel Becker Cc: ocfs2-devel@oss.oracle.com Signed-off-by: Rasmus Villemoes --- fs/ocfs2/cluster/heartbeat.c | 2 +- fs/ocfs2/cluster/masklog.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 7303929..eec35c2 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -2244,7 +2244,7 @@ ssize_t o2hb_heartbeat_group_mode_store(struct o2hb_heartbeat_group *group, return -EINVAL; for (i = 0; i < O2HB_HEARTBEAT_NUM_MODES; ++i) { - if (strnicmp(page, o2hb_heartbeat_mode_desc[i], len)) + if (strncasecmp(page, o2hb_heartbeat_mode_desc[i], len)) continue; ret = o2hb_global_heartbeat_mode_set(i); diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c index 07ac24f..af7598b 100644 --- a/fs/ocfs2/cluster/masklog.c +++ b/fs/ocfs2/cluster/masklog.c @@ -49,13 +49,13 @@ static ssize_t mlog_mask_show(u64 mask, char *buf) static ssize_t mlog_mask_store(u64 mask, const char *buf, size_t count) { - if (!strnicmp(buf, "allow", 5)) { + if (!strncasecmp(buf, "allow", 5)) { __mlog_set_u64(mask, mlog_and_bits); __mlog_clear_u64(mask, mlog_not_bits); - } else if (!strnicmp(buf, "deny", 4)) { + } else if (!strncasecmp(buf, "deny", 4)) { __mlog_set_u64(mask, mlog_not_bits); __mlog_clear_u64(mask, mlog_and_bits); - } else if (!strnicmp(buf, "off", 3)) { + } else if (!strncasecmp(buf, "off", 3)) { __mlog_clear_u64(mask, mlog_not_bits); __mlog_clear_u64(mask, mlog_and_bits); } else