From patchwork Sun Nov 30 08:26:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 5407341 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0507ABEEA8 for ; Sun, 30 Nov 2014 08:28:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22E6020121 for ; Sun, 30 Nov 2014 08:28:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0CA7920120 for ; Sun, 30 Nov 2014 08:28:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752002AbaK3I1C (ORCPT ); Sun, 30 Nov 2014 03:27:02 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34343 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990AbaK3I07 (ORCPT ); Sun, 30 Nov 2014 03:26:59 -0500 Received: by mail-pa0-f45.google.com with SMTP id lj1so9143989pab.32 for ; Sun, 30 Nov 2014 00:26:59 -0800 (PST) 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:in-reply-to:references; bh=tcR/pZizgV5/cMqtLXXQpmu6eUUCawIDZlDTnbitKcA=; b=kh37EhWqLrQYFPxKXn/m21hajdSvVJpwB1MTexcbLnSVzuHO6RdInYKh63s7PQeL/b C/kbE9ejenNfj/XsPLBmydTTX5vxChqjaNTyFc5aLJihkNJ9vRplNylm/U17XXlLTdHA MCNUtR6EPmxXyXcYhBqr1YfG2EYwQMzpQMNy5666QMNd1mcSgZ/dliILxjbiznA6fD2v 366AAkrDv0j/ShJgYfqC+dkqAtO0AlOpj5YqoGXL1JcL5NM4IVV+t0+749aOqtsczI4Z 1011od//zDXHfxVcfzcn8TppnyKxepXbEEaqo4KOe02U0u39mail6ul1cHVo5pVtMek8 fvKQ== X-Gm-Message-State: ALoCoQnDYBuqIQ0MObdVu1arIsusrX0z617Vy7Jk3PwKIgT/nPdD8HVXq27MA6V//dQjgkW3uHTB X-Received: by 10.68.246.164 with SMTP id xx4mr89029997pbc.64.1417336018955; Sun, 30 Nov 2014 00:26:58 -0800 (PST) Received: from mew.localdomain ([72.192.100.38]) by mx.google.com with ESMTPSA id k10sm14383316pdm.3.2014.11.30.00.26.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 30 Nov 2014 00:26:58 -0800 (PST) From: Omar Sandoval To: Chris Mason , Josef Bacik , Joe Perches , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org Cc: Omar Sandoval Subject: [PATCH 1/3] rcustring: clean up botched __rcu annotations Date: Sun, 30 Nov 2014 00:26:47 -0800 Message-Id: <7e64d06eeb464f70319ef85a19e3d7095fbdc2f8.1417335583.git.osandov@osandov.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 The rcu_string returned by rcu_string_strdup isn't technically under RCU yet, and it makes more sense not to treat it as such. Additionally, an rcu_string passed to rcu_string_free should already be rcu_dereferenced and therefore not in the __rcu address space. Signed-off-by: Omar Sandoval --- include/linux/rcustring.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/rcustring.h b/include/linux/rcustring.h index 67277ab..28bd9bc 100644 --- a/include/linux/rcustring.h +++ b/include/linux/rcustring.h @@ -37,8 +37,7 @@ struct rcu_string { * @src: The string to copy * @flags: Flags for kmalloc */ -static inline struct rcu_string __rcu *rcu_string_strdup(const char *src, - gfp_t flags) +static inline struct rcu_string *rcu_string_strdup(const char *src, gfp_t flags) { struct rcu_string *ret; size_t len = strlen(src) + 1; @@ -54,7 +53,7 @@ static inline struct rcu_string __rcu *rcu_string_strdup(const char *src, * rcu_string_free() - free an RCU string * @str: The string */ -static inline void rcu_string_free(struct rcu_string __rcu *str) +static inline void rcu_string_free(struct rcu_string *str) { if (str) kfree_rcu(str, rcu);