From patchwork Wed Oct 3 21:25:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10625319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC3CE1731 for ; Wed, 3 Oct 2018 21:25:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC1F82907A for ; Wed, 3 Oct 2018 21:25:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF9BA29075; Wed, 3 Oct 2018 21:25:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D7B129075 for ; Wed, 3 Oct 2018 21:25:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726182AbeJDEP4 (ORCPT ); Thu, 4 Oct 2018 00:15:56 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39147 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbeJDEP4 (ORCPT ); Thu, 4 Oct 2018 00:15:56 -0400 Received: by mail-wr1-f65.google.com with SMTP id 61-v6so6937921wrb.6 for ; Wed, 03 Oct 2018 14:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=BSEtLhtMxlhWxBmFZ5WmjfEo6SLSapuYS3V11fI2OKQ=; b=N/LFE7s7n/ZFnk+O3dbkbrccsvIEHKqpLpq51FlM22FSDDbmr2l3AIlNgeFGsoAtpc JSul6Jgp9K9D9Jm1mOTj975TdwFEEeQJTUsihPSEZBvmzS8aRf1uVwaF5C81IMnJ6pB5 4P+ZhBsJAMlfkKbqYhYsI/n1abo7BlgJc29GGjvp/PJ1mzpsdaujkFiCLQc4/T3ZVNb9 asK3uyZ3Dxg9PC0XQihCybsTHNY0s6RJe0AohrWdoRTuVk3gmCPNWGQp13kDrTixNghd C9Cg4FKVQm1qCblsCBefB/QDTE3eAmaY+sOJACuaygIeH2i/wcZSwfQ0leHIIfDLLPJh Ntjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BSEtLhtMxlhWxBmFZ5WmjfEo6SLSapuYS3V11fI2OKQ=; b=Hd4kov7e2R0ygAa907iajvNXz01kOP+XijkbRQAouL95t3JF0B1+DklxvqdsWqv3Eg 97Dbmoq4tDcRCCNMQPlYZ7KXtxuDRYje0x5K6aHb7AaH5/AVmCHmWzE143br+9mxvAT3 GLxGZ9Wob3vhRYVrjE/o+Q2FKnzUQKWZB2+p7FlNdSdM9rP7406GJQebiOF7U5LyVZC2 6Dsb9lSPcYcRHALWK1BEzy+qcglbXAMVLCI+V0dAeTES1LkPu4Cg1v+AbEQn4go3dNqC JrG1wgazVlIEK8O7MZl29HoFcZbeEnNgZDZph59A95nIW8LB0thB/dl7BNWXuCRZDT4F NUjA== X-Gm-Message-State: ABuFfohY4adKDRQrsQOAVlJG7kZosGXHNKBmxRbb78ulMIcrOu2/W4+H RudcMg2oOpslDic0GsMVdRncYzFA X-Google-Smtp-Source: ACcGV60IsBVR8fsbHK19clyUkpkZlxZGe6bETVHfrNQCQj+aEKVGzBwYGClDEIL2Eip828VhyQOgmg== X-Received: by 2002:a5d:4ec8:: with SMTP id s8-v6mr2491933wrv.32.1538601948239; Wed, 03 Oct 2018 14:25:48 -0700 (PDT) Received: from localhost.localdomain ([141.226.14.107]) by smtp.gmail.com with ESMTPSA id 193-v6sm4073866wmj.21.2018.10.03.14.25.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 14:25:47 -0700 (PDT) From: Amir Goldstein To: Jan Kara Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH v3 0/8] New fanotify event info API Date: Thu, 4 Oct 2018 00:25:31 +0300 Message-Id: <20181003212539.2384-1-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 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 Jan, Following is the fanotify cleanup for internal constants followed by the FAN_EVENT_INFO_TID API change. The work is available on branch fanotify_api-v3 [1]. Work was tested against the inotify/fanotify LTP tests including my new fanotify10 test and FAN_EVENT_INFO_TID test fanotify11 by nixiaoming, both available on my LTP tree [2]. Per your request, the series is based on commit 96a71f21ef1f ("fanotify: store fanotify_init() flags in group's fanotify_data") from your 'fsnotify' branch. As you can see, the cleanup grew a few more patches since v2: - Patch 1 is the separate fix you requested for FAN_MARK_ONDIR - Patches 2-3 then get rid of FAN_MARK_ONDIR - Patch 4 convert FAN_ALL_* users to use FANOTIFY_* constants This convention in inline with some existing FANOTIFY_* internal constants and with INOTIFY_ and FSNOTIFY_ internal constants - Patches 5-6 add the bits weight validators you requested - Patch 7 (FAN_EVENT_INFO_TID) is mostly unmodified from v2 - Patch 8 is a bonus low hanging optimization I suppose you can leave that last patch out, because I have not done any performance tests with in, but if you find it is "probably an improvement" maybe put it in next and let the LKP robots let us know what they think. Thanks, Amir. [1] https://github.com/amir73il/linux/commits/fanotify_api-v3 [2] https://github.com/amir73il/ltp/commits/fanotify_unpriv Amir Goldstein (8): fanotify: fix collision of internal and uapi mark flags fsnotify: generalize handling of extra event flags fanotify: simplify handling of FAN_ONDIR fanotify: deprecate uapi FAN_ALL_* constants fsnotify: convert runtime BUG_ON() to BUILD_BUG_ON() fanotify: add BUILD_BUG_ON() to count the bits of fanotify constants fanotify: support reporting thread id instead of process id fsnotify: optimize away srcu_read_lock() for events on directories fs/notify/dnotify/dnotify.c | 5 ++- fs/notify/fanotify/fanotify.c | 17 ++++++--- fs/notify/fanotify/fanotify.h | 4 +- fs/notify/fanotify/fanotify_user.c | 57 ++++++++++------------------ fs/notify/fsnotify.c | 16 +++++--- fs/notify/inotify/inotify_user.c | 6 +-- include/linux/fanotify.h | 61 ++++++++++++++++++++++++++++-- include/linux/fsnotify_backend.h | 9 ++++- include/uapi/linux/fanotify.h | 21 +++++----- 9 files changed, 126 insertions(+), 70 deletions(-)