* [PATCH] xfs: use container_of in vn_from_inode()
@ 2006-06-19 11:44 Alexey Dobriyan
2006-06-20 6:59 ` Andrew Morton
0 siblings, 1 reply; 5+ messages in thread
From: Alexey Dobriyan @ 2006-06-19 11:44 UTC (permalink / raw)
To: Nathan Scott; +Cc: linux-fsdevel, Andrew Morton
There is no list in vnode <=> inode correspondence.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
fs/xfs/linux-2.6/xfs_vnode.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -118,7 +118,7 @@ typedef enum {
*/
static inline struct vnode *vn_from_inode(struct inode *inode)
{
- return (vnode_t *)list_entry(inode, vnode_t, v_inode);
+ return (vnode_t *)container_of(inode, vnode_t, v_inode);
}
static inline struct inode *vn_to_inode(struct vnode *vnode)
{
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] xfs: use container_of in vn_from_inode()
2006-06-19 11:44 [PATCH] xfs: use container_of in vn_from_inode() Alexey Dobriyan
@ 2006-06-20 6:59 ` Andrew Morton
2006-06-20 7:28 ` Nathan Scott
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2006-06-20 6:59 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: nathans, linux-fsdevel
On Mon, 19 Jun 2006 15:44:50 +0400
Alexey Dobriyan <adobriyan@gmail.com> wrote:
> static inline struct vnode *vn_from_inode(struct inode *inode)
> {
> - return (vnode_t *)list_entry(inode, vnode_t, v_inode);
> + return (vnode_t *)container_of(inode, vnode_t, v_inode);
> }
The typecast can go away too.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] xfs: use container_of in vn_from_inode()
2006-06-20 6:59 ` Andrew Morton
@ 2006-06-20 7:28 ` Nathan Scott
2006-06-20 7:42 ` Andrew Morton
0 siblings, 1 reply; 5+ messages in thread
From: Nathan Scott @ 2006-06-20 7:28 UTC (permalink / raw)
To: Alexey Dobriyan, Andrew Morton; +Cc: linux-fsdevel
On Mon, Jun 19, 2006 at 11:59:31PM -0700, Andrew Morton wrote:
> > - return (vnode_t *)list_entry(inode, vnode_t, v_inode);
> > + return (vnode_t *)container_of(inode, vnode_t, v_inode);
Whats the point of this change? list_entry == container_of.
Is list_entry being removed from list.h?
This wont apply as-is to -mm, as the XFS code has moved on.
Please send XFS patches to xfs@oss.sgi.com, Alexey, thanks.
cheers.
--
Nathan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] xfs: use container_of in vn_from_inode()
2006-06-20 7:28 ` Nathan Scott
@ 2006-06-20 7:42 ` Andrew Morton
2006-06-20 8:04 ` Nathan Scott
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2006-06-20 7:42 UTC (permalink / raw)
To: Nathan Scott; +Cc: adobriyan, linux-fsdevel
On Tue, 20 Jun 2006 17:28:19 +1000
Nathan Scott <nathans@sgi.com> wrote:
> On Mon, Jun 19, 2006 at 11:59:31PM -0700, Andrew Morton wrote:
> > > - return (vnode_t *)list_entry(inode, vnode_t, v_inode);
> > > + return (vnode_t *)container_of(inode, vnode_t, v_inode);
>
> Whats the point of this change?
It's just a cleanup. We're not dealing with a list_head here, so don't use
list_head functions on it.
> list_entry == container_of.
> Is list_entry being removed from list.h?
Nope.
> This wont apply as-is to -mm, as the XFS code has moved on.
I fixed that up.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] xfs: use container_of in vn_from_inode()
2006-06-20 7:42 ` Andrew Morton
@ 2006-06-20 8:04 ` Nathan Scott
0 siblings, 0 replies; 5+ messages in thread
From: Nathan Scott @ 2006-06-20 8:04 UTC (permalink / raw)
To: Andrew Morton; +Cc: adobriyan, linux-fsdevel
On Tue, Jun 20, 2006 at 12:42:15AM -0700, Andrew Morton wrote:
> On Tue, 20 Jun 2006 17:28:19 +1000
> Nathan Scott <nathans@sgi.com> wrote:
> > On Mon, Jun 19, 2006 at 11:59:31PM -0700, Andrew Morton wrote:
> > > > - return (vnode_t *)list_entry(inode, vnode_t, v_inode);
> > > > + return (vnode_t *)container_of(inode, vnode_t, v_inode);
> >
> > Whats the point of this change?
>
> It's just a cleanup. We're not dealing with a list_head here, so don't use
> list_head functions on it.
Mkay, fair enough.
> > list_entry == container_of.
> > Is list_entry being removed from list.h?
>
> Nope.
>
> > This wont apply as-is to -mm, as the XFS code has moved on.
>
> I fixed that up.
Thanks.
--
Nathan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-06-20 8:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-19 11:44 [PATCH] xfs: use container_of in vn_from_inode() Alexey Dobriyan
2006-06-20 6:59 ` Andrew Morton
2006-06-20 7:28 ` Nathan Scott
2006-06-20 7:42 ` Andrew Morton
2006-06-20 8:04 ` Nathan Scott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).