From patchwork Fri Apr 3 01:56:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 6153121 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B61BC9F2EC for ; Fri, 3 Apr 2015 02:00:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DBAC82035E for ; Fri, 3 Apr 2015 02:00:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD486202FE for ; Fri, 3 Apr 2015 02:00:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753199AbbDCCAY (ORCPT ); Thu, 2 Apr 2015 22:00:24 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:44943 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752925AbbDCCAX (ORCPT ); Thu, 2 Apr 2015 22:00:23 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1YdquE-0002qi-Lq; Thu, 02 Apr 2015 20:00:22 -0600 Received: from 70-59-163-10.omah.qwest.net ([70.59.163.10] helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1YdquD-0003Lp-Rz; Thu, 02 Apr 2015 20:00:22 -0600 From: "Eric W. Biederman" To: Linux Containers Cc: , "Serge E. Hallyn" , Andy Lutomirski , Richard Weinberger , Andrey Vagin , Al Viro , Jann Horn , Willy Tarreau , Omar Sandoval Date: Thu, 2 Apr 2015 20:56:05 -0500 Message-Id: <1428026183-14879-1-git-send-email-ebiederm@xmission.com> X-Mailer: git-send-email 2.2.1 In-Reply-To: <87a8yqou41.fsf_-_@x220.int.ebiederm.org> References: <87a8yqou41.fsf_-_@x220.int.ebiederm.org> X-XM-AID: U2FsdGVkX19Wm+1JN/qGkOIT4CxRM0ZCeHp+buauygw= X-SA-Exim-Connect-IP: 70.59.163.10 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: 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-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Linux Containers X-Spam-Relay-Country: X-Spam-Timing: total 428 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.2 (0.7%), b_tie_ro: 2.3 (0.5%), parse: 0.56 (0.1%), extract_message_metadata: 9 (2.1%), get_uri_detail_list: 0.58 (0.1%), tests_pri_-1000: 4.7 (1.1%), tests_pri_-950: 1.03 (0.2%), tests_pri_-900: 0.85 (0.2%), tests_pri_-400: 18 (4.3%), check_bayes: 18 (4.1%), b_tokenize: 3.5 (0.8%), b_tok_get_all: 8 (1.8%), b_comp_prob: 1.04 (0.2%), b_tok_touch_all: 2.2 (0.5%), b_finish: 0.60 (0.1%), tests_pri_0: 385 (89.8%), tests_pri_500: 3.5 (0.8%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH review 01/19] mnt: Use hlist_move_list in namespace_unlock X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Small cleanup to make the code more readable and maintainable. Signed-off-by: Eric Biederman --- fs/namespace.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index 82ef1405260e..e1ee57206eef 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1298,17 +1298,15 @@ static HLIST_HEAD(unmounted); /* protected by namespace_sem */ static void namespace_unlock(void) { - struct hlist_head head = unmounted; + struct hlist_head head; - if (likely(hlist_empty(&head))) { - up_write(&namespace_sem); - return; - } + hlist_move_list(&unmounted, &head); - head.first->pprev = &head.first; - INIT_HLIST_HEAD(&unmounted); up_write(&namespace_sem); + if (likely(hlist_empty(&head))) + return; + synchronize_rcu(); group_pin_kill(&head);