Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1255507

Re: [PATCH] btrfs: zero out delayed node upon allocation

From Alexandru Moise <00moses.alexander00@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] btrfs: zero out delayed node upon allocation
Date 2015-10-25 18:00 +0100
Message-ID <qnwOf-5nX-21@gated-at.bofh.it> (permalink)
References <qnuMp-4bC-1@gated-at.bofh.it> <qnw1P-57Y-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> > This allows us to trim out half of btrfs_init_delayed_node() which
> > is now reduntant.
> 
> It's redundant if kmem_cache_zalloc is used, but you haven't
> documented that doing so is now required.  For all of these changes
> you've posted, if they're to be accepted, I'd really prefer to set up
> the slab with a constructor instead.  Then we don't need to worry
> about such guarantees.  The object returned via kmem_cache_alloc will
> always be properly initialized.

Well I wouldn't say it's *required* just makes this particular piece
of code neater, since we memset-zero the node's inode_item _anyways_.
I like the constructor idea though, do you suggest I should invest in
that idea?

> 
> This makes assumptions about atomic_t and what atomic_set does that
> aren't guaranteed to be true.  When accessors/mutators are part of the
> API they should be used.
> 
> - -Jeff

You're right, taking out that atomic_set was really stupid. I'll
resent the patch with a proper explanation in the commit message and
put the atomic_set back.

Unless you feel that the change is rather pointless, I'll gladly back
off :-).

Regards,
	Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] btrfs: zero out delayed node upon allocation Alexandru Moise <00moses.alexander00@gmail.com> - 2015-10-25 15:50 +0100
  Re: [PATCH] btrfs: zero out delayed node upon allocation Jeff Mahoney <jeffm@suse.com> - 2015-10-25 17:10 +0100
    Re: [PATCH] btrfs: zero out delayed node upon allocation Alexandru Moise <00moses.alexander00@gmail.com> - 2015-10-25 18:00 +0100
      Re: [PATCH] btrfs: zero out delayed node upon allocation Jeff Mahoney <jeffm@suse.com> - 2015-10-25 18:40 +0100
        Re: [PATCH] btrfs: zero out delayed node upon allocation Alexandru Moise <00moses.alexander00@gmail.com> - 2015-10-25 18:40 +0100

csiph-web