mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e231c2ee64
commit
b46980feed
3 changed files with 28 additions and 5 deletions
|
|
@ -184,11 +184,19 @@ just takes the superblock and inode number as arguments and does the
|
|||
test and set for you.
|
||||
|
||||
e.g.
|
||||
inode = iget_locked(sb, ino);
|
||||
if (inode->i_state & I_NEW) {
|
||||
read_inode_from_disk(inode);
|
||||
unlock_new_inode(inode);
|
||||
}
|
||||
inode = iget_locked(sb, ino);
|
||||
if (inode->i_state & I_NEW) {
|
||||
err = read_inode_from_disk(inode);
|
||||
if (err < 0) {
|
||||
iget_failed(inode);
|
||||
return err;
|
||||
}
|
||||
unlock_new_inode(inode);
|
||||
}
|
||||
|
||||
Note that if the process of setting up a new inode fails, then iget_failed()
|
||||
should be called on the inode to render it dead, and an appropriate error
|
||||
should be passed back to the caller.
|
||||
|
||||
---
|
||||
[recommended]
|
||||
|
|
|
|||
Loading…
Reference in a new issue