aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-02-09 16:27:09 -0500
committerTheodore Ts'o <tytso@mit.edu>2013-02-09 16:27:09 -0500
commit1139575a927010390c6b38e4215a6d741b056074 (patch)
tree0fb06dbe63ed7aaa2e14ce4c03587fd9c4f87b63 /fs/ext4/ext4.h
parent95eaefbdececae5e781d76d03fe7472a857c8c7a (diff)
ext4: start handle at the last possible moment when creating inodes
In ext4_{create,mknod,mkdir,symlink}(), don't start the journal handle until the inode has been succesfully allocated. In order to do this, we need to start the handle in the ext4_new_inode(). So create a new variant of this function, ext4_new_inode_start_handle(), so the handle can be created at the last possible minute, before we need to modify the inode allocation bitmap block. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 61ecf059f70c..fc1c0375c9f2 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2004,9 +2004,20 @@ extern int ext4fs_dirhash(const char *name, int len, struct
2004 dx_hash_info *hinfo); 2004 dx_hash_info *hinfo);
2005 2005
2006/* ialloc.c */ 2006/* ialloc.c */
2007extern struct inode *ext4_new_inode(handle_t *, struct inode *, umode_t, 2007extern struct inode *__ext4_new_inode(handle_t *, struct inode *, umode_t,
2008 const struct qstr *qstr, __u32 goal, 2008 const struct qstr *qstr, __u32 goal,
2009 uid_t *owner); 2009 uid_t *owner, int handle_type,
2010 unsigned int line_no, int nblocks);
2011
2012#define ext4_new_inode(handle, dir, mode, qstr, goal, owner) \
2013 __ext4_new_inode((handle), (dir), (mode), (qstr), (goal), (owner), \
2014 0, 0, 0)
2015#define ext4_new_inode_start_handle(dir, mode, qstr, goal, owner, \
2016 type, nblocks) \
2017 __ext4_new_inode(NULL, (dir), (mode), (qstr), (goal), (owner), \
2018 (type), __LINE__, (nblocks))
2019
2020
2010extern void ext4_free_inode(handle_t *, struct inode *); 2021extern void ext4_free_inode(handle_t *, struct inode *);
2011extern struct inode * ext4_orphan_get(struct super_block *, unsigned long); 2022extern struct inode * ext4_orphan_get(struct super_block *, unsigned long);
2012extern unsigned long ext4_count_free_inodes(struct super_block *); 2023extern unsigned long ext4_count_free_inodes(struct super_block *);