aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext2/namei.c')
-rw-r--r--fs/ext2/namei.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index 73b0d9519836..256dd5f4c1c4 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -119,6 +119,29 @@ static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode
119 return ext2_add_nondir(dentry, inode); 119 return ext2_add_nondir(dentry, inode);
120} 120}
121 121
122static int ext2_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
123{
124 struct inode *inode = ext2_new_inode(dir, mode, NULL);
125 if (IS_ERR(inode))
126 return PTR_ERR(inode);
127
128 inode->i_op = &ext2_file_inode_operations;
129 if (ext2_use_xip(inode->i_sb)) {
130 inode->i_mapping->a_ops = &ext2_aops_xip;
131 inode->i_fop = &ext2_xip_file_operations;
132 } else if (test_opt(inode->i_sb, NOBH)) {
133 inode->i_mapping->a_ops = &ext2_nobh_aops;
134 inode->i_fop = &ext2_file_operations;
135 } else {
136 inode->i_mapping->a_ops = &ext2_aops;
137 inode->i_fop = &ext2_file_operations;
138 }
139 mark_inode_dirty(inode);
140 d_tmpfile(dentry, inode);
141 unlock_new_inode(inode);
142 return 0;
143}
144
122static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode, dev_t rdev) 145static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode, dev_t rdev)
123{ 146{
124 struct inode * inode; 147 struct inode * inode;
@@ -398,6 +421,7 @@ const struct inode_operations ext2_dir_inode_operations = {
398#endif 421#endif
399 .setattr = ext2_setattr, 422 .setattr = ext2_setattr,
400 .get_acl = ext2_get_acl, 423 .get_acl = ext2_get_acl,
424 .tmpfile = ext2_tmpfile,
401}; 425};
402 426
403const struct inode_operations ext2_special_inode_operations = { 427const struct inode_operations ext2_special_inode_operations = {