aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/porting
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-02-07 03:15:27 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:26 -0500
commitb46980feed937868d3333514028bfbe9a651e4ca (patch)
tree97e610932986223932887af3c0ea00234856e540 /Documentation/filesystems/porting
parente231c2ee64eb1c5cd3c63c31da9dac7d888dcf7f (diff)
iget: introduce a function to register iget failure
Introduce a function to register failure in an inode construction path. This includes marking the inode under construction as bad, unlocking it and releasing it. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/filesystems/porting')
-rw-r--r--Documentation/filesystems/porting18
1 files changed, 13 insertions, 5 deletions
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index 0f33c77bc14b..fbd3815a5f57 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -184,11 +184,19 @@ just takes the superblock and inode number as arguments and does the
184test and set for you. 184test and set for you.
185 185
186e.g. 186e.g.
187 inode = iget_locked(sb, ino); 187 inode = iget_locked(sb, ino);
188 if (inode->i_state & I_NEW) { 188 if (inode->i_state & I_NEW) {
189 read_inode_from_disk(inode); 189 err = read_inode_from_disk(inode);
190 unlock_new_inode(inode); 190 if (err < 0) {
191 } 191 iget_failed(inode);
192 return err;
193 }
194 unlock_new_inode(inode);
195 }
196
197Note that if the process of setting up a new inode fails, then iget_failed()
198should be called on the inode to render it dead, and an appropriate error
199should be passed back to the caller.
192 200
193--- 201---
194[recommended] 202[recommended]