<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/inode.c, branch v2.6.25</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>iget: remove iget() and the read_inode() super op as being obsolete</title>
<updated>2008-02-07T16:42:29+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2008-02-07T08:15:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=12debc4248a4a7f1873e47cda2cdd7faca80b099'/>
<id>12debc4248a4a7f1873e47cda2cdd7faca80b099</id>
<content type='text'>
Remove the old iget() call and the read_inode() superblock operation it uses
as these are really obsolete, and the use of read_inode() does not produce
proper error handling (no distinction between ENOMEM and EIO when marking an
inode bad).

Furthermore, this removes the temptation to use iget() to find an inode by
number in a filesystem from code outside that filesystem.

iget_locked() should be used instead.  A new function is added in an earlier
patch (iget_failed) that is to be called to mark an inode as bad, unlock it
and release it should the get routine fail.  Mark iget() and read_inode() as
being obsolete and remove references to them from the documentation.

Typically a filesystem will be modified such that the read_inode function
becomes an internal iget function, for example the following:

	void thingyfs_read_inode(struct inode *inode)
	{
		...
	}

would be changed into something like:

	struct inode *thingyfs_iget(struct super_block *sp, unsigned long ino)
	{
		struct inode *inode;
		int ret;

		inode = iget_locked(sb, ino);
		if (!inode)
			return ERR_PTR(-ENOMEM);
		if (!(inode-&gt;i_state &amp; I_NEW))
			return inode;

		...
		unlock_new_inode(inode);
		return inode;
	error:
		iget_failed(inode);
		return ERR_PTR(ret);
	}

and then thingyfs_iget() would be called rather than iget(), for example:

	ret = -EINVAL;
	inode = iget(sb, ino);
	if (!inode || is_bad_inode(inode))
		goto error;

becomes:

	inode = thingyfs_iget(sb, ino);
	if (IS_ERR(inode)) {
		ret = PTR_ERR(inode);
		goto error;
	}

Note that is_bad_inode() does not need to be called.  The error returned by
thingyfs_iget() should render it unnecessary.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove the old iget() call and the read_inode() superblock operation it uses
as these are really obsolete, and the use of read_inode() does not produce
proper error handling (no distinction between ENOMEM and EIO when marking an
inode bad).

Furthermore, this removes the temptation to use iget() to find an inode by
number in a filesystem from code outside that filesystem.

iget_locked() should be used instead.  A new function is added in an earlier
patch (iget_failed) that is to be called to mark an inode as bad, unlock it
and release it should the get routine fail.  Mark iget() and read_inode() as
being obsolete and remove references to them from the documentation.

Typically a filesystem will be modified such that the read_inode function
becomes an internal iget function, for example the following:

	void thingyfs_read_inode(struct inode *inode)
	{
		...
	}

would be changed into something like:

	struct inode *thingyfs_iget(struct super_block *sp, unsigned long ino)
	{
		struct inode *inode;
		int ret;

		inode = iget_locked(sb, ino);
		if (!inode)
			return ERR_PTR(-ENOMEM);
		if (!(inode-&gt;i_state &amp; I_NEW))
			return inode;

		...
		unlock_new_inode(inode);
		return inode;
	error:
		iget_failed(inode);
		return ERR_PTR(ret);
	}

and then thingyfs_iget() would be called rather than iget(), for example:

	ret = -EINVAL;
	inode = iget(sb, ino);
	if (!inode || is_bad_inode(inode))
		goto error;

becomes:

	inode = thingyfs_iget(sb, ino);
	if (IS_ERR(inode)) {
		ret = PTR_ERR(inode);
		goto error;
	}

Note that is_bad_inode() does not need to be called.  The error returned by
thingyfs_iget() should render it unnecessary.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: Add inode version support in ext4</title>
<updated>2008-01-29T04:58:27+00:00</updated>
<author>
<name>Jean Noel Cordenner</name>
<email>jean-noel.cordenner@bull.net</email>
</author>
<published>2008-01-29T04:58:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=25ec56b518257a56d2ff41a941d288e4b5ff9488'/>
<id>25ec56b518257a56d2ff41a941d288e4b5ff9488</id>
<content type='text'>
This patch adds 64-bit inode version support to ext4. The lower 32 bits
are stored in the osd1.linux1.l_i_version field while the high 32 bits
are stored in the i_version_hi field newly created in the ext4_inode.
This field is incremented in case the ext4_inode is large enough. A
i_version mount option has been added to enable the feature.

Signed-off-by: Mingming Cao &lt;cmm@us.ibm.com&gt;
Signed-off-by: Andreas Dilger &lt;adilger@clusterfs.com&gt;
Signed-off-by: Kalpak Shah &lt;kalpak@clusterfs.com&gt;
Signed-off-by: Aneesh Kumar K.V &lt;aneesh.kumar@linux.vnet.ibm.com&gt;
Signed-off-by: Jean Noel Cordenner &lt;jean-noel.cordenner@bull.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds 64-bit inode version support to ext4. The lower 32 bits
are stored in the osd1.linux1.l_i_version field while the high 32 bits
are stored in the i_version_hi field newly created in the ext4_inode.
This field is incremented in case the ext4_inode is large enough. A
i_version mount option has been added to enable the feature.

Signed-off-by: Mingming Cao &lt;cmm@us.ibm.com&gt;
Signed-off-by: Andreas Dilger &lt;adilger@clusterfs.com&gt;
Signed-off-by: Kalpak Shah &lt;kalpak@clusterfs.com&gt;
Signed-off-by: Aneesh Kumar K.V &lt;aneesh.kumar@linux.vnet.ibm.com&gt;
Signed-off-by: Jean Noel Cordenner &lt;jean-noel.cordenner@bull.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: Add 64 bit i_version support</title>
<updated>2008-01-29T04:58:27+00:00</updated>
<author>
<name>Jean Noel Cordenner</name>
<email>jean-noel.cordenner@bull.net</email>
</author>
<published>2008-01-29T04:58:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7a224228ed79d587ece2304869000aad1b8e97dd'/>
<id>7a224228ed79d587ece2304869000aad1b8e97dd</id>
<content type='text'>
The i_version field of the inode is changed to be a 64-bit counter that
is set on every inode creation and that is incremented every time the
inode data is modified (similarly to the "ctime" time-stamp).
The aim is to fulfill a NFSv4 requirement for rfc3530.
This first part concerns the vfs, it converts the 32-bit i_version in
the generic inode to a 64-bit, a flag is added in the super block in
order to check if the feature is enabled and the i_version is
incremented in the vfs.

Signed-off-by: Mingming Cao &lt;cmm@us.ibm.com&gt;
Signed-off-by: Jean Noel Cordenner &lt;jean-noel.cordenner@bull.net&gt;
Signed-off-by: Kalpak Shah &lt;kalpak@clusterfs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The i_version field of the inode is changed to be a 64-bit counter that
is set on every inode creation and that is incremented every time the
inode data is modified (similarly to the "ctime" time-stamp).
The aim is to fulfill a NFSv4 requirement for rfc3530.
This first part concerns the vfs, it converts the 32-bit i_version in
the generic inode to a 64-bit, a flag is added in the super block in
order to check if the feature is enabled and the i_version is
incremented in the vfs.

Signed-off-by: Mingming Cao &lt;cmm@us.ibm.com&gt;
Signed-off-by: Jean Noel Cordenner &lt;jean-noel.cordenner@bull.net&gt;
Signed-off-by: Kalpak Shah &lt;kalpak@clusterfs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>introduce I_SYNC</title>
<updated>2007-10-17T15:43:02+00:00</updated>
<author>
<name>Joern Engel</name>
<email>joern@wohnheim.fh-wedel.de</email>
</author>
<published>2007-10-17T06:30:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1c0eeaf5698597146ed9b873e2f9e0961edcf0f9'/>
<id>1c0eeaf5698597146ed9b873e2f9e0961edcf0f9</id>
<content type='text'>
I_LOCK was used for several unrelated purposes, which caused deadlock
situations in certain filesystems as a side effect.  One of the purposes
now uses the new I_SYNC bit.

Also document the various bits and change their order from historical to
logical.

[bunk@stusta.de: make fs/inode.c:wake_up_inode() static]
Signed-off-by: Joern Engel &lt;joern@wohnheim.fh-wedel.de&gt;
Cc: Dave Kleikamp &lt;shaggy@linux.vnet.ibm.com&gt;
Cc: David Chinner &lt;dgc@sgi.com&gt;
Cc: Anton Altaparmakov &lt;aia21@cam.ac.uk&gt;
Cc: Al Viro &lt;viro@ftp.linux.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I_LOCK was used for several unrelated purposes, which caused deadlock
situations in certain filesystems as a side effect.  One of the purposes
now uses the new I_SYNC bit.

Also document the various bits and change their order from historical to
logical.

[bunk@stusta.de: make fs/inode.c:wake_up_inode() static]
Signed-off-by: Joern Engel &lt;joern@wohnheim.fh-wedel.de&gt;
Cc: Dave Kleikamp &lt;shaggy@linux.vnet.ibm.com&gt;
Cc: David Chinner &lt;dgc@sgi.com&gt;
Cc: Anton Altaparmakov &lt;aia21@cam.ac.uk&gt;
Cc: Al Viro &lt;viro@ftp.linux.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: remove the unused mempages parameter</title>
<updated>2007-10-17T15:42:49+00:00</updated>
<author>
<name>Denis Cheng</name>
<email>crquan@gmail.com</email>
</author>
<published>2007-10-17T06:26:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=74bf17cffc32511c7c6d70fe7f376b92662e186e'/>
<id>74bf17cffc32511c7c6d70fe7f376b92662e186e</id>
<content type='text'>
Since the mempages parameter is actually not used, they should be removed.

Now there is only files_init use the mempages parameter,

 	files_init(mempages);

but I don't think the adaptation to mempages in files_init is really
useful; and if files_init also changed to the prototype void (*func)(void),
the wrapper vfs_caches_init would also not need the mempages parameter.

Signed-off-by: Denis Cheng &lt;crquan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since the mempages parameter is actually not used, they should be removed.

Now there is only files_init use the mempages parameter,

 	files_init(mempages);

but I don't think the adaptation to mempages in files_init is really
useful; and if files_init also changed to the prototype void (*func)(void),
the wrapper vfs_caches_init would also not need the mempages parameter.

Signed-off-by: Denis Cheng &lt;crquan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Slab API: remove useless ctor parameter and reorder parameters</title>
<updated>2007-10-17T15:42:45+00:00</updated>
<author>
<name>Christoph Lameter</name>
<email>clameter@sgi.com</email>
</author>
<published>2007-10-17T06:25:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4ba9b9d0ba0a49d91fa6417c7510ee36f48cf957'/>
<id>4ba9b9d0ba0a49d91fa6417c7510ee36f48cf957</id>
<content type='text'>
Slab constructors currently have a flags parameter that is never used.  And
the order of the arguments is opposite to other slab functions.  The object
pointer is placed before the kmem_cache pointer.

Convert

        ctor(void *object, struct kmem_cache *s, unsigned long flags)

to

        ctor(struct kmem_cache *s, void *object)

throughout the kernel

[akpm@linux-foundation.org: coupla fixes]
Signed-off-by: Christoph Lameter &lt;clameter@sgi.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Slab constructors currently have a flags parameter that is never used.  And
the order of the arguments is opposite to other slab functions.  The object
pointer is placed before the kmem_cache pointer.

Convert

        ctor(void *object, struct kmem_cache *s, unsigned long flags)

to

        ctor(struct kmem_cache *s, void *object)

throughout the kernel

[akpm@linux-foundation.org: coupla fixes]
Signed-off-by: Christoph Lameter &lt;clameter@sgi.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: fixup the inode dir annotation</title>
<updated>2007-10-16T17:01:50+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2007-10-16T04:47:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1e89a5e15a2c88b3fd1ed3fa17fd767efe44727a'/>
<id>1e89a5e15a2c88b3fd1ed3fa17fd767efe44727a</id>
<content type='text'>
A slight oversight tripped lockdep debugging code, each lockdep
class should have but a single init site.

Rearange the code to make this true.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A slight oversight tripped lockdep debugging code, each lockdep
class should have but a single init site.

Rearange the code to make this true.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: annotate dir vs file i_mutex</title>
<updated>2007-10-13T23:38:33+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2007-10-13T23:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=14358e6ddaed27499d7d366b3e65c3e46b39e1c4'/>
<id>14358e6ddaed27499d7d366b3e65c3e46b39e1c4</id>
<content type='text'>
On Mon, 2007-09-24 at 22:13 -0400, Steven Rostedt wrote:
&gt; The circular lock seems to be this:
&gt; 
&gt; #1:
&gt; 
&gt;   sys_mmap2:              down_write(&amp;mm-&gt;mmap_sem);
&gt;   nfs_revalidate_mapping: mutex_lock(&amp;inode-&gt;i_mutex);
&gt; 
&gt; 
&gt; #0:
&gt; 
&gt;   vfs_readdir:     mutex_lock(&amp;inode-&gt;i_mutex);
&gt;    - during the readdir (filldir64), we take a user fault (missing page?)
&gt;     and call do_page_fault -
&gt;   do_page_fault:   down_read(&amp;mm-&gt;mmap_sem);
&gt; 
&gt; 
&gt; So it does indeed look like a circular locking. Now the question is, "is
&gt; this a bug?".  Looking like the inode of #1 must be a file or something
&gt; else that you can mmap and the inode of #0 seems it must be a directory.
&gt; I would say "no".
&gt; 
&gt; Now if you can readdir on a file or mmap a directory, then this could be
&gt; an issue.
&gt; 
&gt; Otherwise, I'd love to see someone teach lockdep about this issue! ;-)

Make a distinction between file and dir usage of i_mutex.
The inode should be complete and unused at unlock_new_inode(), re-init
i_mutex depending on its type.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Mon, 2007-09-24 at 22:13 -0400, Steven Rostedt wrote:
&gt; The circular lock seems to be this:
&gt; 
&gt; #1:
&gt; 
&gt;   sys_mmap2:              down_write(&amp;mm-&gt;mmap_sem);
&gt;   nfs_revalidate_mapping: mutex_lock(&amp;inode-&gt;i_mutex);
&gt; 
&gt; 
&gt; #0:
&gt; 
&gt;   vfs_readdir:     mutex_lock(&amp;inode-&gt;i_mutex);
&gt;    - during the readdir (filldir64), we take a user fault (missing page?)
&gt;     and call do_page_fault -
&gt;   do_page_fault:   down_read(&amp;mm-&gt;mmap_sem);
&gt; 
&gt; 
&gt; So it does indeed look like a circular locking. Now the question is, "is
&gt; this a bug?".  Looking like the inode of #1 must be a file or something
&gt; else that you can mmap and the inode of #0 seems it must be a directory.
&gt; I would say "no".
&gt; 
&gt; Now if you can readdir on a file or mmap a directory, then this could be
&gt; an issue.
&gt; 
&gt; Otherwise, I'd love to see someone teach lockdep about this issue! ;-)

Make a distinction between file and dir usage of i_mutex.
The inode should be complete and unused at unlock_new_inode(), re-init
i_mutex depending on its type.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: per filesystem inode lock class</title>
<updated>2007-10-15T12:51:31+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2007-10-15T12:51:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d475fd428ce77aa2a8bc650d230e17663a4f49c3'/>
<id>d475fd428ce77aa2a8bc650d230e17663a4f49c3</id>
<content type='text'>
Give each filesystem its own inode lock class. The various filesystems have
different locking order wrt the inode locks; esp. the pseudo filesystems differ
from the rest.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Give each filesystem its own inode lock class. The various filesystems have
different locking order wrt the inode locks; esp. the pseudo filesystems differ
from the rest.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mm: Remove slab destructors from kmem_cache_create().</title>
<updated>2007-07-20T01:11:58+00:00</updated>
<author>
<name>Paul Mundt</name>
<email>lethal@linux-sh.org</email>
</author>
<published>2007-07-20T01:11:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=20c2df83d25c6a95affe6157a4c9cac4cf5ffaac'/>
<id>20c2df83d25c6a95affe6157a4c9cac4cf5ffaac</id>
<content type='text'>
Slab destructors were no longer supported after Christoph's
c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
BUGs for both slab and slub, and slob never supported them
either.

This rips out support for the dtor pointer from kmem_cache_create()
completely and fixes up every single callsite in the kernel (there were
about 224, not including the slab allocator definitions themselves,
or the documentation references).

Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Slab destructors were no longer supported after Christoph's
c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
BUGs for both slab and slub, and slob never supported them
either.

This rips out support for the dtor pointer from kmem_cache_create()
completely and fixes up every single callsite in the kernel (there were
about 224, not including the slab allocator definitions themselves,
or the documentation references).

Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
