052-04-ubifs-Use-move-variable-in-ubifs_rename.patch 887 B

123456789101112131415161718192021222324252627282930
  1. From: Richard Weinberger <richard@nod.at>
  2. Date: Tue, 13 Sep 2016 16:18:58 +0200
  3. Subject: [PATCH] ubifs: Use move variable in ubifs_rename()
  4. ...to make the code more consistent since we use
  5. move already in other places.
  6. Signed-off-by: Richard Weinberger <richard@nod.at>
  7. ---
  8. --- a/fs/ubifs/journal.c
  9. +++ b/fs/ubifs/journal.c
  10. @@ -1100,7 +1100,7 @@ int ubifs_jnl_rename(struct ubifs_info *
  11. aligned_dlen1 = ALIGN(dlen1, 8);
  12. aligned_dlen2 = ALIGN(dlen2, 8);
  13. len = aligned_dlen1 + aligned_dlen2 + ALIGN(ilen, 8) + ALIGN(plen, 8);
  14. - if (old_dir != new_dir)
  15. + if (move)
  16. len += plen;
  17. dent = kmalloc(len, GFP_NOFS);
  18. if (!dent)
  19. @@ -1216,7 +1216,7 @@ int ubifs_jnl_rename(struct ubifs_info *
  20. if (err)
  21. goto out_ro;
  22. - if (old_dir != new_dir) {
  23. + if (move) {
  24. offs += ALIGN(plen, 8);
  25. ino_key_init(c, &key, new_dir->i_ino);
  26. err = ubifs_tnc_add(c, &key, lnum, offs, plen);