X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fntfs%2Frunlist.c;fp=fs%2Fntfs%2Frunlist.c;h=061b5ff6b73cec10f317f566cd3dc6fa8512e9d9;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=eb52b801512bc8027d2def23cd2359cd9f96a1ca;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/fs/ntfs/runlist.c b/fs/ntfs/runlist.c index eb52b8015..061b5ff6b 100644 --- a/fs/ntfs/runlist.c +++ b/fs/ntfs/runlist.c @@ -381,7 +381,6 @@ static inline runlist_element *ntfs_rl_insert(runlist_element *dst, static inline runlist_element *ntfs_rl_replace(runlist_element *dst, int dsize, runlist_element *src, int ssize, int loc) { - signed delta; BOOL left = FALSE; /* Left end of @src needs merging. */ BOOL right = FALSE; /* Right end of @src needs merging. */ int tail; /* Start of tail of @dst. */ @@ -397,14 +396,11 @@ static inline runlist_element *ntfs_rl_replace(runlist_element *dst, left = ntfs_are_rl_mergeable(dst + loc - 1, src); /* * Allocate some space. We will need less if the left, right, or both - * ends get merged. The -1 accounts for the run being replaced. + * ends get merged. */ - delta = ssize - 1 - left - right; - if (delta > 0) { - dst = ntfs_rl_realloc(dst, dsize, dsize + delta); - if (IS_ERR(dst)) - return dst; - } + dst = ntfs_rl_realloc(dst, dsize, dsize + ssize - left - right); + if (IS_ERR(dst)) + return dst; /* * We are guaranteed to succeed from here so can start modifying the * original runlists.