- int cp_err = 0;
- /*
- * Ideally, the file whose extents we are about to manipulate is using the
- * newer offset-based IVs so that we can manipulate it regardless of the
- * current lock state. However, we must maintain support for older-style
- * EAs.
- *
- * For the older EA case, the IV was tied to the device LBA for file content.
- * This means that encrypted data cannot be moved from one location to another
- * in the filesystem without garbling the IV data. As a result, we need to
- * access the file's plaintext because we cannot do our AES-symmetry trick
- * here. This requires that we attempt a key-unwrap here (via cp_handle_relocate)
- * to make forward progress. If the keys are unavailable then we will
- * simply stop the resize in its tracks here since we cannot move
- * this extent at this time.
- */
- if ((cp->c_cpentry->cp_flags & CP_OFF_IV_ENABLED) == 0) {
- cp_err = cp_handle_relocate(cp, hfsmp);
- }
-
- if (cp_err) {
- printf ("hfs_copy_extent: cp_handle_relocate failed (%d) \n", cp_err);
- return cp_err;
- }
-