[Patch] fs/romfs/inode.c: trivial improvements

2007-07-18 Thread WANG Cong

1. There's no lists in fs/romfs/inode.c, so using list_entry is
a bit confusing. Replace it with container_of.

2. It is unnecessary to cast the return value of kmem_cache_alloc,
since it returns a void* pointer.

This patch is against 2.6.22.1.

Signed-off-by: WANG Cong [EMAIL PROTECTED]

---
 fs/romfs/inode.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.22.1/fs/romfs/inode.c
===
--- linux-2.6.22.1.orig/fs/romfs/inode.c2007-07-12 00:47:28.0 
+0800
+++ linux-2.6.22.1/fs/romfs/inode.c 2007-07-18 16:08:56.0 +0800
@@ -92,7 +92,7 @@
 
 static inline struct romfs_inode_info *ROMFS_I(struct inode *inode)
 {
-   return list_entry(inode, struct romfs_inode_info, vfs_inode);
+   return container_of(inode, struct romfs_inode_info, vfs_inode);
 }
 
 static __u32
@@ -555,7 +555,7 @@
 static struct inode *romfs_alloc_inode(struct super_block *sb)
 {
struct romfs_inode_info *ei;
-   ei = (struct romfs_inode_info *)kmem_cache_alloc(romfs_inode_cachep, 
GFP_KERNEL);
+   ei = kmem_cache_alloc(romfs_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
return ei-vfs_inode;
-
To unsubscribe from this list: send the line unsubscribe linux-fsdevel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 2/5] inode reservation v0.1 (ext4 kernel patch)

2007-05-24 Thread WANG Cong
On Thu, May 24, 2007 at 06:26:26PM +0200, Jan Engelhardt wrote:

On May 24 2007 22:47, coly wrote:

Dave,

Yes, I found all TABs gone when I received the mail. When I post next
version of the patch, I will test to send to me first :-)

Thanks for your information.

Blame Gmail.


   Jan

I am using gmail too. That's not gmail's fault, I think your email client sucks.
So which email client are you using, coly? I recommend mutt to you. ;)

Have fun!

-
To unsubscribe from this list: send the line unsubscribe linux-fsdevel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html