Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp929441pxj; Fri, 21 May 2021 02:26:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWlBOCCqvyEsJA4+zhqNxWHFDyjIDDtGTcg8kQlBfPvE0ajPCjqoCpJFewvyQOsshlTXJ7 X-Received: by 2002:a17:906:a017:: with SMTP id p23mr9589274ejy.460.1621589185162; Fri, 21 May 2021 02:26:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621589185; cv=none; d=google.com; s=arc-20160816; b=F8sQkYGRKo081yk3APbJCBLoDA0VDBfIaiQ7Eh0AcvWGEPbDe4cH01LRWZdgZzxwb3 BT1kb1Blz5UlcQfWaEPOhXBTL3tkhY7bYZde/fP4jH1IOwdML4msKKfkWgULr6pplVb0 W7HX7Mxm7qgqekxc8UzkxvpSOA9EE5EM8v79Ze8MV5w+wTsvrdYo0zOA4vDVfyHmbOb4 qCAFAUfMFZJQBI3lkBxjO+AD/mEWjJD8UzI+hXcf5MZQuU3WC2emWZbUjPOFmVmKAAlE 5aqQdXzrn8m9d9PKkj4Q2XtR3H0288SZviGFJAftPcBVddX5qljEUUIT3SU4X1gY04e6 NiuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=SfF409PcvZhbXqnHCpqCfVdESmyMvMfYnavelxQEric=; b=QDyk6+rkIpeQzA2vuvEm3XrV+htEGDWW1o+L2k6SIpVz1L9ARNp2daLzcVCh4P9uvz 8txuIn4bi1E5hJGmIvPisMe/KPe53r/0nouBm6DOykKEoYL2MsoAT35plBH8pHNcFX4f 0ZviYOoORxVBgTs4cJVp1HZ+dZ1QlKFB+9nF4vGqu5rggu+0P/qHZxnkDurwourjssgl AEOVwzsAdsKy4R+2qgjQRLXlcY35FCe5AVE/MEekgsovMiLS0McJCmOziy+WIGiNCXeN YN/8LDF+1+fcFtMCUBz3y8m74RJa+9MMsIKjow6/utDuHRrbTybMHbVexxEma8wTy+jg UaOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j15si4613713edp.143.2021.05.21.02.26.01; Fri, 21 May 2021 02:26:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238666AbhEUCnr (ORCPT + 99 others); Thu, 20 May 2021 22:43:47 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:54932 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231681AbhEUCnq (ORCPT ); Thu, 20 May 2021 22:43:46 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 93E351F43D7A From: Gabriel Krisman Bertazi To: amir73il@gmail.com Cc: Gabriel Krisman Bertazi , kernel@collabora.com, "Darrick J . Wong" , Theodore Ts'o , Dave Chinner , jack@suse.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: [PATCH 07/11] fsnotify: Introduce helpers to send error_events Date: Thu, 20 May 2021 22:41:30 -0400 Message-Id: <20210521024134.1032503-8-krisman@collabora.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210521024134.1032503-1-krisman@collabora.com> References: <20210521024134.1032503-1-krisman@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Signed-off-by: Gabriel Krisman Bertazi --- Changes since v2: - Use the inode argument (Amir) --- include/linux/fsnotify.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index f8acddcf54fb..458e4feb5fe1 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h @@ -317,4 +317,17 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) fsnotify_dentry(dentry, mask); } +static inline void fsnotify_error_event(struct super_block *sb, struct inode *inode, + int error) +{ + if (sb->s_fsnotify_marks) { + struct fs_error_report report = { + .error = error, + .inode = inode, + }; + fsnotify(FS_ERROR, &report, FSNOTIFY_EVENT_ERROR, NULL, NULL, + sb->s_root->d_inode, 0); + } +} + #endif /* _LINUX_FS_NOTIFY_H */ -- 2.31.0