All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Matthew Bobrowski <mbobrowski@mbobrowski.org>,
	linux-fsdevel@vger.kernel.org,
	Matthew Bobrowski <repnop@google.com>
Subject: [PATCH v2 1/4] fsnotify: replace igrab() with ihold() on attach connector
Date: Tue, 10 Aug 2021 18:12:17 +0300	[thread overview]
Message-ID: <20210810151220.285179-2-amir73il@gmail.com> (raw)
In-Reply-To: <20210810151220.285179-1-amir73il@gmail.com>

We must have a reference on inode, so ihold is cheaper.

Reviewed-by: Matthew Bobrowski <repnop@google.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 fs/notify/mark.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index d32ab349db74..80459db58f63 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -493,8 +493,11 @@ static int fsnotify_attach_connector_to_object(fsnotify_connp_t *connp,
 		conn->fsid.val[0] = conn->fsid.val[1] = 0;
 		conn->flags = 0;
 	}
-	if (conn->type == FSNOTIFY_OBJ_TYPE_INODE)
-		inode = igrab(fsnotify_conn_inode(conn));
+	if (conn->type == FSNOTIFY_OBJ_TYPE_INODE) {
+		inode = fsnotify_conn_inode(conn);
+		ihold(inode);
+	}
+
 	/*
 	 * cmpxchg() provides the barrier so that readers of *connp can see
 	 * only initialized structure
-- 
2.32.0


  reply	other threads:[~2021-08-10 15:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 15:12 [PATCH v2 0/4] Performance optimization for no fsnotify marks Amir Goldstein
2021-08-10 15:12 ` Amir Goldstein [this message]
2021-08-10 15:12 ` [PATCH v2 2/4] fsnotify: count s_fsnotify_inode_refs for attached connectors Amir Goldstein
2021-08-10 15:12 ` [PATCH v2 3/4] fsnotify: count all objects with " Amir Goldstein
2021-08-10 21:49   ` Matthew Bobrowski
2021-08-11 11:37   ` Jan Kara
2021-08-11 13:59     ` Amir Goldstein
2021-08-10 15:12 ` [PATCH v2 4/4] fsnotify: optimize the case of no marks of any type Amir Goldstein
2021-08-11 12:02 ` [PATCH v2 0/4] Performance optimization for no fsnotify marks Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210810151220.285179-2-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mbobrowski@mbobrowski.org \
    --cc=repnop@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.