Optimize a bit previous ntfs_inode_close fix.
parent
b8e1188102
commit
9deb743974
|
|
@ -249,14 +249,18 @@ int ntfs_inode_close(ntfs_inode *ni)
|
||||||
memmove(tmp_nis + i, tmp_nis + i + 1,
|
memmove(tmp_nis + i, tmp_nis + i + 1,
|
||||||
(base_ni->nr_extents - i - 1) *
|
(base_ni->nr_extents - i - 1) *
|
||||||
sizeof(ntfs_inode *));
|
sizeof(ntfs_inode *));
|
||||||
|
/* Buffer should be for multiple of four extents. */
|
||||||
|
if ((--base_ni->nr_extents) & 3) {
|
||||||
|
i = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* ElectricFence is unhappy with realloc(x,0) as free(x)
|
* ElectricFence is unhappy with realloc(x,0) as free(x)
|
||||||
* thus we explicitely separate these two cases.
|
* thus we explicitely separate these two cases.
|
||||||
*/
|
*/
|
||||||
if (--base_ni->nr_extents) {
|
if (base_ni->nr_extents) {
|
||||||
/* Resize the memory buffer. */
|
/* Resize the memory buffer. */
|
||||||
tmp_nis = realloc(tmp_nis, ((base_ni->
|
tmp_nis = realloc(tmp_nis, base_ni->nr_extents *
|
||||||
nr_extents + 3) & ~3) *
|
|
||||||
sizeof(ntfs_inode *));
|
sizeof(ntfs_inode *));
|
||||||
/* Ignore errors, they don't really matter. */
|
/* Ignore errors, they don't really matter. */
|
||||||
if (tmp_nis)
|
if (tmp_nis)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue