diff options
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r-- | fs/ocfs2/namei.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 28dd757ff67d..2bcf353fd7c5 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -175,8 +175,6 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry, | |||
175 | 175 | ||
176 | inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno, 0); | 176 | inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno, 0); |
177 | if (IS_ERR(inode)) { | 177 | if (IS_ERR(inode)) { |
178 | mlog(ML_ERROR, "Unable to create inode %llu\n", | ||
179 | (unsigned long long)blkno); | ||
180 | ret = ERR_PTR(-EACCES); | 178 | ret = ERR_PTR(-EACCES); |
181 | goto bail_unlock; | 179 | goto bail_unlock; |
182 | } | 180 | } |
@@ -189,7 +187,6 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry, | |||
189 | * unlink. */ | 187 | * unlink. */ |
190 | spin_lock(&oi->ip_lock); | 188 | spin_lock(&oi->ip_lock); |
191 | oi->ip_flags &= ~OCFS2_INODE_MAYBE_ORPHANED; | 189 | oi->ip_flags &= ~OCFS2_INODE_MAYBE_ORPHANED; |
192 | oi->ip_orphaned_slot = OCFS2_INVALID_SLOT; | ||
193 | spin_unlock(&oi->ip_lock); | 190 | spin_unlock(&oi->ip_lock); |
194 | 191 | ||
195 | bail_add: | 192 | bail_add: |
@@ -288,7 +285,7 @@ static int ocfs2_fill_new_dir(struct ocfs2_super *osb, | |||
288 | 285 | ||
289 | i_size_write(inode, inode->i_sb->s_blocksize); | 286 | i_size_write(inode, inode->i_sb->s_blocksize); |
290 | inode->i_nlink = 2; | 287 | inode->i_nlink = 2; |
291 | inode->i_blocks = ocfs2_align_bytes_to_sectors(inode->i_sb->s_blocksize); | 288 | inode->i_blocks = ocfs2_inode_sector_count(inode); |
292 | status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); | 289 | status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); |
293 | if (status < 0) { | 290 | if (status < 0) { |
294 | mlog_errno(status); | 291 | mlog_errno(status); |
@@ -1486,8 +1483,7 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb, | |||
1486 | struct buffer_head **bhs = NULL; | 1483 | struct buffer_head **bhs = NULL; |
1487 | const char *c; | 1484 | const char *c; |
1488 | struct super_block *sb = osb->sb; | 1485 | struct super_block *sb = osb->sb; |
1489 | u64 p_blkno; | 1486 | u64 p_blkno, p_blocks; |
1490 | int p_blocks; | ||
1491 | int virtual, blocks, status, i, bytes_left; | 1487 | int virtual, blocks, status, i, bytes_left; |
1492 | 1488 | ||
1493 | bytes_left = i_size_read(inode) + 1; | 1489 | bytes_left = i_size_read(inode) + 1; |
@@ -1514,8 +1510,8 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb, | |||
1514 | goto bail; | 1510 | goto bail; |
1515 | } | 1511 | } |
1516 | 1512 | ||
1517 | status = ocfs2_extent_map_get_blocks(inode, 0, 1, &p_blkno, | 1513 | status = ocfs2_extent_map_get_blocks(inode, 0, &p_blkno, &p_blocks, |
1518 | &p_blocks); | 1514 | NULL); |
1519 | if (status < 0) { | 1515 | if (status < 0) { |
1520 | mlog_errno(status); | 1516 | mlog_errno(status); |
1521 | goto bail; | 1517 | goto bail; |
@@ -1674,8 +1670,11 @@ static int ocfs2_symlink(struct inode *dir, | |||
1674 | inode->i_rdev = 0; | 1670 | inode->i_rdev = 0; |
1675 | newsize = l - 1; | 1671 | newsize = l - 1; |
1676 | if (l > ocfs2_fast_symlink_chars(sb)) { | 1672 | if (l > ocfs2_fast_symlink_chars(sb)) { |
1673 | u32 offset = 0; | ||
1674 | |||
1677 | inode->i_op = &ocfs2_symlink_inode_operations; | 1675 | inode->i_op = &ocfs2_symlink_inode_operations; |
1678 | status = ocfs2_do_extend_allocation(osb, inode, 1, new_fe_bh, | 1676 | status = ocfs2_do_extend_allocation(osb, inode, &offset, 1, |
1677 | new_fe_bh, | ||
1679 | handle, data_ac, NULL, | 1678 | handle, data_ac, NULL, |
1680 | NULL); | 1679 | NULL); |
1681 | if (status < 0) { | 1680 | if (status < 0) { |
@@ -1689,7 +1688,7 @@ static int ocfs2_symlink(struct inode *dir, | |||
1689 | goto bail; | 1688 | goto bail; |
1690 | } | 1689 | } |
1691 | i_size_write(inode, newsize); | 1690 | i_size_write(inode, newsize); |
1692 | inode->i_blocks = ocfs2_align_bytes_to_sectors(newsize); | 1691 | inode->i_blocks = ocfs2_inode_sector_count(inode); |
1693 | } else { | 1692 | } else { |
1694 | inode->i_op = &ocfs2_fast_symlink_inode_operations; | 1693 | inode->i_op = &ocfs2_fast_symlink_inode_operations; |
1695 | memcpy((char *) fe->id2.i_symlink, symname, l); | 1694 | memcpy((char *) fe->id2.i_symlink, symname, l); |
@@ -2222,9 +2221,7 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb, | |||
2222 | /* Record which orphan dir our inode now resides | 2221 | /* Record which orphan dir our inode now resides |
2223 | * in. delete_inode will use this to determine which orphan | 2222 | * in. delete_inode will use this to determine which orphan |
2224 | * dir to lock. */ | 2223 | * dir to lock. */ |
2225 | spin_lock(&OCFS2_I(inode)->ip_lock); | 2224 | fe->i_orphaned_slot = cpu_to_le16(osb->slot_num); |
2226 | OCFS2_I(inode)->ip_orphaned_slot = osb->slot_num; | ||
2227 | spin_unlock(&OCFS2_I(inode)->ip_lock); | ||
2228 | 2225 | ||
2229 | mlog(0, "Inode %llu orphaned in slot %d\n", | 2226 | mlog(0, "Inode %llu orphaned in slot %d\n", |
2230 | (unsigned long long)OCFS2_I(inode)->ip_blkno, osb->slot_num); | 2227 | (unsigned long long)OCFS2_I(inode)->ip_blkno, osb->slot_num); |