Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3871520pxy; Mon, 26 Apr 2021 11:45:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM+zob1ZyhBoTPyu0fSVe2gtkYa8AVd6+2sG4vGTSq9XltAAsUsrG5wDbuRrqNdai5hpzi X-Received: by 2002:a17:906:d8a9:: with SMTP id qc9mr19853835ejb.37.1619462724637; Mon, 26 Apr 2021 11:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619462724; cv=none; d=google.com; s=arc-20160816; b=MnM6VgLImSQA7lUF8qauLY2mzEoJjfBe/mLLmGOOCeL6ING4CiDDgJj/2qBZBjUtlP NmtvPx7iRKYdosccs4INtw+CKP7ldML2S8X9FDdnp68wWni9o5WhW+qDCyHQWf202cf6 j6upuiyHzGqNKQK2dx5TQ4hh1LtWAUl9XByTMeaTwkYwofHyAwnf7F28xxBimEmBGhW0 ZTRm32ZezjIYRfSNBhQKZT2khR9fiZWzTrGoedhNxkcWrfkk1BAc5oHxeC93viywGQxW IvUhQ/C/XzxhO5WIXHA4d4V17RWkf90or0Yw+TMdV1DzgNlRo9eBWy2slen/v4BZ7o3i piOw== 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=T1I8lBnKDpV7egUmAL1IGm5V4QeZAh1aJrNjxc05QiA=; b=jKus63BaaOTK1i0BCGfGS5C4d7UdhJiR7aCIAOvU68Kr64vj83TQNsDzlEEm2rkLHI ulQ7J10zJTXd8qcubitlb7w2CZDj5K0Uef4mMqRYQ1eg6yVAU58EZfZcni2AQFdXczEm Y3gVkA94uUStEz0IXM1h6ZDhe23Swm8fn0133QRPt+WNwmh3ePSeZI0Pprsfr6VLLhzn v26Z1uRhx8suEMbEIXONqZB4HOnJCtAdFNOL+TiDf8/BSSN7gRXs3h5DMxz8dWLNY8lO vgq+Vc8q21A+6cDL7gcBDAy9OB5/xyXWk8njoPzjpr7zsoLY7xYLo3opl57cGnO8V0Su SXvw== 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 v13si536720edl.24.2021.04.26.11.45.00; Mon, 26 Apr 2021 11:45:24 -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 S239479AbhDZSnw (ORCPT + 99 others); Mon, 26 Apr 2021 14:43:52 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:47502 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239394AbhDZSne (ORCPT ); Mon, 26 Apr 2021 14:43:34 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id D52811F422D6 From: Gabriel Krisman Bertazi To: amir73il@gmail.com, tytso@mit.edu, djwong@kernel.org Cc: david@fromorbit.com, jack@suse.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi , kernel@collabora.com Subject: [PATCH RFC 08/15] fsnotify: Introduce helpers to send error_events Date: Mon, 26 Apr 2021 14:41:54 -0400 Message-Id: <20210426184201.4177978-9-krisman@collabora.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210426184201.4177978-1-krisman@collabora.com> References: <20210426184201.4177978-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 --- include/linux/fsnotify.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index f8acddcf54fb..b3ac1a9d0d4d 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h @@ -317,4 +317,19 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) fsnotify_dentry(dentry, mask); } +static inline void fsnotify_error_event(int error, struct inode *dir, + const char *function, int line, + void *fs_data, int fs_data_size) +{ + struct fs_error_report report = { + .error = error, + .line = line, + .function = function, + .fs_data_size = fs_data_size, + .fs_data = fs_data, + }; + + fsnotify(FS_ERROR, &report, FSNOTIFY_EVENT_ERROR, dir, NULL, NULL, 0); +} + #endif /* _LINUX_FS_NOTIFY_H */ -- 2.31.0