Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146718872
D14193.id38850.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D14193.id38850.diff
View Options
Index: sys/fs/ext2fs/ext2_extents.c
===================================================================
--- sys/fs/ext2fs/ext2_extents.c
+++ sys/fs/ext2fs/ext2_extents.c
@@ -1159,14 +1159,13 @@
struct m_ext2fs *fs;
e4fs_daddr_t newblk;
- fs = ip->i_e2fs;
-
/*
* We will allocate only single block for now.
*/
if (*count > 1)
return (0);
+ fs = ip->i_e2fs;
EXT2_LOCK(ip->i_ump);
*perror = ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, &newblk);
if (*perror)
@@ -1193,11 +1192,9 @@
unsigned long allocated = 0;
int error = 0, depth;
- fs = ip->i_e2fs;
- *pallocated = 0;
- path = NULL;
if(bpp)
*bpp = NULL;
+ *pallocated = 0;
/* Check cache. */
if ((bpref = ext4_ext_in_cache(ip, iblk, &newex))) {
@@ -1208,6 +1205,7 @@
allocated = newex.e_len - (iblk - newex.e_blk);
goto out;
} else {
+ path = NULL;
error = EIO;
goto out2;
}
@@ -1271,6 +1269,7 @@
if (bpp)
{
+ fs = ip->i_e2fs;
error = bread(ip->i_devvp, fsbtodb(fs, newblk),
fs->e2fs_bsize, cred, &bp);
if (error) {
@@ -1304,7 +1303,7 @@
ext4_ext_header(struct inode *ip)
{
- return (struct ext4_extent_header *)ip->i_db;
+ return ((struct ext4_extent_header *)ip->i_db);
}
static int
@@ -1345,19 +1344,15 @@
ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_path *path,
uint64_t start)
{
- struct m_ext2fs *fs;
- int depth;
struct ext4_extent_header *eh;
+ struct ext4_extent *ex;
unsigned int a, b, block, num;
unsigned long ex_blk;
unsigned short ex_len;
- struct ext4_extent *ex;
+ int depth;
int error, correct_index;
- fs = ip->i_e2fs;
depth = ext4_ext_inode_depth(ip);
- correct_index = 0;
-
if (!path[depth].ep_header) {
if (path[depth].ep_data == NULL)
return (EINVAL);
@@ -1367,7 +1362,8 @@
eh = path[depth].ep_header;
if (!eh) {
- ext2_fserr(fs, ip->i_uid, "bad header => extent corrupted");
+ ext2_fserr(ip->i_e2fs, ip->i_uid,
+ "bad header => extent corrupted");
return (EIO);
}
@@ -1375,6 +1371,8 @@
ex_blk = ex->e_blk;
ex_len = ext4_ext_get_actual_len(ex);
+ error = 0;
+ correct_index = 0;
while (ex >= EXT_FIRST_EXTENT(eh) && ex_blk + ex_len > start) {
path[depth].ep_ext = ex;
a = ex_blk > start ? ex_blk : start;
@@ -1442,7 +1440,6 @@
int error;
fs = ip->i_e2fs;
-
error = bread(ip->i_devvp, fsbtodb(fs, pblk),
fs->e2fs_bsize, NOCRED, &bp);
if (error) {
@@ -1506,14 +1503,13 @@
if (!path)
return (ENOMEM);
- i = 0;
path[0].ep_header = ehp;
path[0].ep_depth = depth;
- while (i >= 0 && error == 0) {
+ i = 0;
+ while (error == 0 && i >= 0) {
if (i == depth) {
/* This is leaf. */
- error = ext4_ext_rm_leaf(ip, path, length);
- if (error)
+ if (error = ext4_ext_rm_leaf(ip, path, length))
break;
free(path[i].ep_data, M_EXT2EXTENTS);
path[i].ep_data = NULL;
@@ -1568,7 +1564,6 @@
ext4_ext_header(ip)->eh_depth = 0;
ext4_ext_header(ip)->eh_max = ext4_ext_space_root(ip);
ext4_ext_dirty(ip, path);
-
}
ext4_ext_drop_refs(path);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 6, 12:22 AM (14 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29304611
Default Alt Text
D14193.id38850.diff (2 KB)
Attached To
Mode
D14193: ext2fs: Tidy ups for variable assignment.
Attached
Detach File
Event Timeline
Log In to Comment