On 9 January 2018 at 14:53, Bob Peterson <[email protected]> wrote:
> Hi,
>
> ----- Original Message -----
> | First, this function truncates the file in chunks.  When the original
> | file size isn't block aligned, each chunk that is truncated will remain
> | be misaligned.  This is inefficient.
> |
> | Second, this function doesn't recognize where holes are, so it loops
> | through them.  For each chunk of a hole, it creates a new transaction.
> | At least avoid creating another transactions whe the current one is
> | still empty.  (An better fix would be to skip large holes, of course.)
> |
> | Signed-off-by: Andreas Gruenbacher <[email protected]>
> | ---
> (snip)
> | +             /* XXX Is this check sufficient? */
> | +             tr = current->journal_info;
> | +             if (!tr->tr_num_revoke)
> | +                     continue;
>
> Maybe I'm missing your intent here, but perhaps you can use this:
>
>         if (!test_bit(TR_TOUCHED, &tr->tr_flags)) {
>
> like gfs2_trans_end does for determining whether the transaction was
> actually used.

Yes, that should work.

Thanks,
Andreas

Reply via email to