Message ID | 657f50e37d6d8f908c13f652129bcdd34ed7f4a9.1731684329.git.josef@toxicpanda.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B25D7D68BC8 for <linux-mm@archiver.kernel.org>; Fri, 15 Nov 2024 15:32:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FA5F6B00A0; Fri, 15 Nov 2024 10:31:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 984396B00A1; Fri, 15 Nov 2024 10:31:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 823476B00A2; Fri, 15 Nov 2024 10:31:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5FDC06B00A0 for <linux-mm@kvack.org>; Fri, 15 Nov 2024 10:31:46 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C8B03818A4 for <linux-mm@kvack.org>; Fri, 15 Nov 2024 15:31:45 +0000 (UTC) X-FDA: 82788718278.15.4CF383E Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) by imf02.hostedemail.com (Postfix) with ESMTP id EE4AF80021 for <linux-mm@kvack.org>; Fri, 15 Nov 2024 15:30:17 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=fzGm8ckm; dmarc=none; spf=none (imf02.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.128.177) smtp.mailfrom=josef@toxicpanda.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731684639; a=rsa-sha256; cv=none; b=lr34OW8pSQ6dFi1eyiHozI8XWfXEEmycdzPvVwtyKmobjUDVb1i7yzhg79w7zIafmwCclZ ci1uGk4fQQAN44PGPVlSJjPfPp5a0cKbUuBoevPn1mc7x/y9YFYJXm9a36AOsvQXrA6Gws sCmF9rWSsradHKBlEAa/ArC0ZaL0Fi4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=fzGm8ckm; dmarc=none; spf=none (imf02.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.128.177) smtp.mailfrom=josef@toxicpanda.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731684639; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rLlpuiMn0030yB3+s74DQOOZuZXxBi++zrJRvWIMp3o=; b=VkLvjI74uSRfeWXG95QjCoaX3XPKqWbvtvNTgj6hTplYVGOjdfc4WxbgiWPnFSVe5Fwl9W UXoz59wBZfwXw+cCGpwONM5ZHliCFVDIoq9s2BWPjA26XRttGGe2680rD4j4lAGUTzwPXa HkR3MEyeuihxud4PItaVR8P1RIutAvg= Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-6e9f8dec3daso15669767b3.0 for <linux-mm@kvack.org>; Fri, 15 Nov 2024 07:31:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1731684703; x=1732289503; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=rLlpuiMn0030yB3+s74DQOOZuZXxBi++zrJRvWIMp3o=; b=fzGm8ckmrKIGP1b6xitsOWrDPjXrGxOwwnljrFtKBUVWP2c6nio9zD03nVe8xe/7ji /JEeqnOwkx45KMorQrIZSbrUtDkYfSJjHm9drA+/OSaJEyXEYwkjRHYkulAjKrRM249d zrblxw5y3G2nRWa9WqKClUbP5eoEsAwhAZNxgegN5aX4QuHALsLKG8dkelClw3/0gtGl x93dlZGZTarKNEVN7iVz/+zvAeTM34OZDCNkpSIcG4KBRbtnxGE96AkhKnOMtcjDjWWg yLm338uVIDDhwi9uC7rvP/1xt5aqADAYgZsTtkrXXpz7bmcCnIIgg+lYwh3Et5UW2zzY wLFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731684703; x=1732289503; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rLlpuiMn0030yB3+s74DQOOZuZXxBi++zrJRvWIMp3o=; b=ZFy/EgFPPPVWm/ig346nZtvqX7yyyxF6HVxrkbnZUYHIdf85tt+bm2am4YXu6kJh1x T1171SI1IDd0vvjJu1aidaTAFgpXYpp3Nlpv4DSOOS3AW4JmhNkoK5bMfxkePWMmI20Q qvXE7z7gzNrGN/SK0PsXNmnqLX5yj6keQbcXq9Sz6xRT/rFKWRC3ZjY5GDK2ztU8huxk 6X3e3QgwRsfIf7qtIHgUMdmGo5ElPkoXKMnknLpEBZgDgmHjKt2Wr1CIPsY4A7rjpzwQ wxiDXJLxRbRtfSDhTLapvVGFRKSfmqRYDO6T4jYHTbcQQ2JSYV9OviQViotBbdh+cKkx W0ZA== X-Forwarded-Encrypted: i=1; AJvYcCXxNKGBhvqShaFgC7l5LCwYQFI/GiGPMRNTacOhw5yj+PrdSUMnT9qo0Yw7uqZRZ3knV6CNrp/9fw==@kvack.org X-Gm-Message-State: AOJu0YzNpCXjKfSns/3hUttsDAskLUm+uGgEQoSIzE29sRSimZ0n5Lqu PTegxG6XM5bbDm1hSmMijwPO6Dm447hpA4gR9ucw2u6GTFGrJvGiI43NcvNjxOw= X-Google-Smtp-Source: AGHT+IHLmXNsFgoxeQH2zoAuWGXM6iZ0/bFoZDUBvajKhRUeKgJ2+BFXj02LrLEKz+I9Qy3GGhxCnw== X-Received: by 2002:a05:690c:6806:b0:6dc:7877:1ea3 with SMTP id 00721157ae682-6ee55a6c9ebmr38646357b3.17.1731684703143; Fri, 15 Nov 2024 07:31:43 -0800 (PST) Received: from localhost (syn-076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6ee4400c7dasm7862627b3.24.2024.11.15.07.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 07:31:42 -0800 (PST) From: Josef Bacik <josef@toxicpanda.com> To: kernel-team@fb.com, linux-fsdevel@vger.kernel.org, jack@suse.cz, amir73il@gmail.com, brauner@kernel.org, torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org Subject: [PATCH v8 13/19] fanotify: add a helper to check for pre content events Date: Fri, 15 Nov 2024 10:30:26 -0500 Message-ID: <657f50e37d6d8f908c13f652129bcdd34ed7f4a9.1731684329.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <cover.1731684329.git.josef@toxicpanda.com> References: <cover.1731684329.git.josef@toxicpanda.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: EE4AF80021 X-Rspamd-Server: rspam01 X-Stat-Signature: do14kwpa7g5kkj7qnfb3upig5js6ztq5 X-HE-Tag: 1731684617-474806 X-HE-Meta: U2FsdGVkX18kKWA2mB8/GkW1U51aRCDAYDPQhFTCoZs6+p0n8YvcgfBmIHIVA0xZ18IMs3DTvVlmW8ztcpVAVrzDAxtSrk/1Ip/9yUL/N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zh1FXcOLuWKvFimnagqlI7muDV9YzHoijSi6Px+J90j36XUg207374Nz011ohQy0jgVUKQ3puEWLlRKEFe+nC0uxmP4Hm8LP78Cj8RlYfGkgnOUnJxj+uWtbi7yA2dWc2xmF+/P93dbjjhvh1IX1dFOEqKQ+kcBETIZcwS+2d8N6jtZzXaMGZtMwY/Wj3eJLFT321vI/wC4jdp/e1YMRoGIs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
fanotify: add pre-content hooks
|
expand
|
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 08893429a818..d5a0d8648000 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h @@ -178,6 +178,11 @@ static inline void file_set_fsnotify_mode(struct file *file) } } +static inline bool fsnotify_file_has_pre_content_watches(struct file *file) +{ + return file && unlikely(FMODE_FSNOTIFY_HSM(file->f_mode)); +} + /* * fsnotify_file_area_perm - permission hook before access to file range */ @@ -264,6 +269,11 @@ static inline void file_set_fsnotify_mode(struct file *file) { } +static inline bool fsnotify_file_has_pre_content_watches(struct file *file) +{ + return false; +} + static inline int fsnotify_file_area_perm(struct file *file, int perm_mask, const loff_t *ppos, size_t count) {