Re: [PATCH 14/33] fsnotify: Remove indirection from fsnotify_detach_mark()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 29-03-17 17:29:26, Miklos Szeredi wrote:
> On Tue, Mar 28, 2017 at 06:13:13PM +0200, Jan Kara wrote:
> > diff --git a/fs/notify/mark.c b/fs/notify/mark.c
> > index f32ca924c44e..509bb17f1a7e 100644
> > --- a/fs/notify/mark.c
> > +++ b/fs/notify/mark.c
> > @@ -141,6 +141,31 @@ void fsnotify_recalc_mask(struct fsnotify_mark_connector *conn)
> >  	}
> >  }
> >  
> > +static struct inode *fsnotify_detach_from_object(struct fsnotify_mark *mark)
> > +{
> > +	struct fsnotify_mark_connector *conn;
> > +	struct inode *inode = NULL;
> > +	spinlock_t *lock;
> > +
> > +	conn = mark->connector;
> > +	if (conn->flags & FSNOTIFY_OBJ_TYPE_INODE)
> > +		lock = &conn->inode->i_lock;
> > +	else
> > +		lock = &conn->mnt->mnt_root->d_lock;
> > +	spin_lock(lock);
> > +	hlist_del_init_rcu(&mark->obj_list);
> > +	if (hlist_empty(&conn->list)) {
> > +		if (conn->flags & FSNOTIFY_OBJ_TYPE_INODE)
> > +			inode = conn->inode;
> > +	} else {
> > +		__fsnotify_recalc_mask(conn);
> 
> Is the mask recalculation deliberately done only when the mark list is
> non-empty?  To me it doesn't look like a worthwhile optimization even if the
> mask value does not matter in that case.

I agree it doesn't really make sense at this place in the series. I'll call
it unconditionally in this patch. About three patches later we'll
explicitely zero out the mask in hlist_empty() case so calling recalc mask
then is just silly.

> Also now __fsnotify_update_child_dentry_flags() is missing.  Even if it's not a
> bug, it should be explained in the changelog.

It's not a bug but I'll do that as a separate change and just keep calling
fsnotify_recalc_mask() in this patch.

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux