linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pipefs unique inode numbers
@ 2007-01-30 22:40 Bodo Eggert
  2007-01-30 22:55 ` Linus Torvalds
  2007-01-31  1:19 ` Jeff Layton
  0 siblings, 2 replies; 8+ messages in thread
From: Bodo Eggert @ 2007-01-30 22:40 UTC (permalink / raw)
  To: akpm, Jeff Layton, dev, linux-kernel, linux-fsdevel, torvalds

change pipefs to use a unique inode number equal to the memory
address unless it would be truncated.

Signed-Off-By: Bodo Eggert <7eggert@gmx.de>
---
Tested on i386.

--- 2.6.19/fs/pipe.c.ori	2007-01-30 22:02:46.000000000 +0100
+++ 2.6.19/fs/pipe.c	2007-01-30 23:22:27.000000000 +0100
@@ -864,6 +864,10 @@ static struct inode * get_pipe_inode(voi
 	inode->i_uid = current->fsuid;
 	inode->i_gid = current->fsgid;
 	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+	/* The address of *inode is unique, so we'll get an unique inode number.
+	 * Off cause this will not work for 32 bit inodes on 64 bit systems. */
+	if (sizeof(inode->i_ino) >= sizeof(struct inode*))
+		inode->i_ino = (unsigned int) inode;
 
 	return inode;
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-01-31  9:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-30 22:40 [PATCH] pipefs unique inode numbers Bodo Eggert
2007-01-30 22:55 ` Linus Torvalds
2007-01-31  0:12   ` Jeff Layton
2007-01-31  1:19 ` Jeff Layton
2007-01-31  1:28   ` Linus Torvalds
2007-01-31  2:02     ` Jeff Layton
2007-01-31  9:19     ` Kirill Korotaev
2007-01-31  1:37   ` Jeff Layton

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).