xfs_extfree_item.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. /*
  2. * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of version 2 of the GNU General Public License as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it would be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. *
  12. * Further, this software is distributed without any warranty that it is
  13. * free of the rightful claim of any third person regarding infringement
  14. * or the like. Any license provided herein, whether implied or
  15. * otherwise, applies only to this software file. Patent licenses, if
  16. * any, provided herein do not apply to combinations of this program with
  17. * other software, or any other product whatsoever.
  18. *
  19. * You should have received a copy of the GNU General Public License along
  20. * with this program; if not, write the Free Software Foundation, Inc., 59
  21. * Temple Place - Suite 330, Boston MA 02111-1307, USA.
  22. *
  23. * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
  24. * Mountain View, CA 94043, or:
  25. *
  26. * http://www.sgi.com
  27. *
  28. * For further information regarding this notice, see:
  29. *
  30. * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  31. */
  32. /*
  33. * This file contains the implementation of the xfs_efi_log_item
  34. * and xfs_efd_log_item items.
  35. */
  36. #include "xfs.h"
  37. #include "xfs_macros.h"
  38. #include "xfs_types.h"
  39. #include "xfs_inum.h"
  40. #include "xfs_log.h"
  41. #include "xfs_trans.h"
  42. #include "xfs_buf_item.h"
  43. #include "xfs_sb.h"
  44. #include "xfs_dir.h"
  45. #include "xfs_dmapi.h"
  46. #include "xfs_mount.h"
  47. #include "xfs_trans_priv.h"
  48. #include "xfs_extfree_item.h"
  49. kmem_zone_t *xfs_efi_zone;
  50. kmem_zone_t *xfs_efd_zone;
  51. STATIC void xfs_efi_item_unlock(xfs_efi_log_item_t *);
  52. STATIC void xfs_efi_item_abort(xfs_efi_log_item_t *);
  53. STATIC void xfs_efd_item_abort(xfs_efd_log_item_t *);
  54. void
  55. xfs_efi_item_free(xfs_efi_log_item_t *efip)
  56. {
  57. int nexts = efip->efi_format.efi_nextents;
  58. if (nexts > XFS_EFI_MAX_FAST_EXTENTS) {
  59. kmem_free(efip, sizeof(xfs_efi_log_item_t) +
  60. (nexts - 1) * sizeof(xfs_extent_t));
  61. } else {
  62. kmem_zone_free(xfs_efi_zone, efip);
  63. }
  64. }
  65. /*
  66. * This returns the number of iovecs needed to log the given efi item.
  67. * We only need 1 iovec for an efi item. It just logs the efi_log_format
  68. * structure.
  69. */
  70. /*ARGSUSED*/
  71. STATIC uint
  72. xfs_efi_item_size(xfs_efi_log_item_t *efip)
  73. {
  74. return 1;
  75. }
  76. /*
  77. * This is called to fill in the vector of log iovecs for the
  78. * given efi log item. We use only 1 iovec, and we point that
  79. * at the efi_log_format structure embedded in the efi item.
  80. * It is at this point that we assert that all of the extent
  81. * slots in the efi item have been filled.
  82. */
  83. STATIC void
  84. xfs_efi_item_format(xfs_efi_log_item_t *efip,
  85. xfs_log_iovec_t *log_vector)
  86. {
  87. uint size;
  88. ASSERT(efip->efi_next_extent == efip->efi_format.efi_nextents);
  89. efip->efi_format.efi_type = XFS_LI_EFI;
  90. size = sizeof(xfs_efi_log_format_t);
  91. size += (efip->efi_format.efi_nextents - 1) * sizeof(xfs_extent_t);
  92. efip->efi_format.efi_size = 1;
  93. log_vector->i_addr = (xfs_caddr_t)&(efip->efi_format);
  94. log_vector->i_len = size;
  95. ASSERT(size >= sizeof(xfs_efi_log_format_t));
  96. }
  97. /*
  98. * Pinning has no meaning for an efi item, so just return.
  99. */
  100. /*ARGSUSED*/
  101. STATIC void
  102. xfs_efi_item_pin(xfs_efi_log_item_t *efip)
  103. {
  104. return;
  105. }
  106. /*
  107. * While EFIs cannot really be pinned, the unpin operation is the
  108. * last place at which the EFI is manipulated during a transaction.
  109. * Here we coordinate with xfs_efi_cancel() to determine who gets to
  110. * free the EFI.
  111. */
  112. /*ARGSUSED*/
  113. STATIC void
  114. xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale)
  115. {
  116. xfs_mount_t *mp;
  117. SPLDECL(s);
  118. mp = efip->efi_item.li_mountp;
  119. AIL_LOCK(mp, s);
  120. if (efip->efi_flags & XFS_EFI_CANCELED) {
  121. /*
  122. * xfs_trans_delete_ail() drops the AIL lock.
  123. */
  124. xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s);
  125. xfs_efi_item_free(efip);
  126. } else {
  127. efip->efi_flags |= XFS_EFI_COMMITTED;
  128. AIL_UNLOCK(mp, s);
  129. }
  130. }
  131. /*
  132. * like unpin only we have to also clear the xaction descriptor
  133. * pointing the log item if we free the item. This routine duplicates
  134. * unpin because efi_flags is protected by the AIL lock. Freeing
  135. * the descriptor and then calling unpin would force us to drop the AIL
  136. * lock which would open up a race condition.
  137. */
  138. STATIC void
  139. xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp)
  140. {
  141. xfs_mount_t *mp;
  142. xfs_log_item_desc_t *lidp;
  143. SPLDECL(s);
  144. mp = efip->efi_item.li_mountp;
  145. AIL_LOCK(mp, s);
  146. if (efip->efi_flags & XFS_EFI_CANCELED) {
  147. /*
  148. * free the xaction descriptor pointing to this item
  149. */
  150. lidp = xfs_trans_find_item(tp, (xfs_log_item_t *) efip);
  151. xfs_trans_free_item(tp, lidp);
  152. /*
  153. * pull the item off the AIL.
  154. * xfs_trans_delete_ail() drops the AIL lock.
  155. */
  156. xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s);
  157. xfs_efi_item_free(efip);
  158. } else {
  159. efip->efi_flags |= XFS_EFI_COMMITTED;
  160. AIL_UNLOCK(mp, s);
  161. }
  162. }
  163. /*
  164. * Efi items have no locking or pushing. However, since EFIs are
  165. * pulled from the AIL when their corresponding EFDs are committed
  166. * to disk, their situation is very similar to being pinned. Return
  167. * XFS_ITEM_PINNED so that the caller will eventually flush the log.
  168. * This should help in getting the EFI out of the AIL.
  169. */
  170. /*ARGSUSED*/
  171. STATIC uint
  172. xfs_efi_item_trylock(xfs_efi_log_item_t *efip)
  173. {
  174. return XFS_ITEM_PINNED;
  175. }
  176. /*
  177. * Efi items have no locking, so just return.
  178. */
  179. /*ARGSUSED*/
  180. STATIC void
  181. xfs_efi_item_unlock(xfs_efi_log_item_t *efip)
  182. {
  183. if (efip->efi_item.li_flags & XFS_LI_ABORTED)
  184. xfs_efi_item_abort(efip);
  185. return;
  186. }
  187. /*
  188. * The EFI is logged only once and cannot be moved in the log, so
  189. * simply return the lsn at which it's been logged. The canceled
  190. * flag is not paid any attention here. Checking for that is delayed
  191. * until the EFI is unpinned.
  192. */
  193. /*ARGSUSED*/
  194. STATIC xfs_lsn_t
  195. xfs_efi_item_committed(xfs_efi_log_item_t *efip, xfs_lsn_t lsn)
  196. {
  197. return lsn;
  198. }
  199. /*
  200. * This is called when the transaction logging the EFI is aborted.
  201. * Free up the EFI and return. No need to clean up the slot for
  202. * the item in the transaction. That was done by the unpin code
  203. * which is called prior to this routine in the abort/fs-shutdown path.
  204. */
  205. STATIC void
  206. xfs_efi_item_abort(xfs_efi_log_item_t *efip)
  207. {
  208. xfs_efi_item_free(efip);
  209. }
  210. /*
  211. * There isn't much you can do to push on an efi item. It is simply
  212. * stuck waiting for all of its corresponding efd items to be
  213. * committed to disk.
  214. */
  215. /*ARGSUSED*/
  216. STATIC void
  217. xfs_efi_item_push(xfs_efi_log_item_t *efip)
  218. {
  219. return;
  220. }
  221. /*
  222. * The EFI dependency tracking op doesn't do squat. It can't because
  223. * it doesn't know where the free extent is coming from. The dependency
  224. * tracking has to be handled by the "enclosing" metadata object. For
  225. * example, for inodes, the inode is locked throughout the extent freeing
  226. * so the dependency should be recorded there.
  227. */
  228. /*ARGSUSED*/
  229. STATIC void
  230. xfs_efi_item_committing(xfs_efi_log_item_t *efip, xfs_lsn_t lsn)
  231. {
  232. return;
  233. }
  234. /*
  235. * This is the ops vector shared by all efi log items.
  236. */
  237. STATIC struct xfs_item_ops xfs_efi_item_ops = {
  238. .iop_size = (uint(*)(xfs_log_item_t*))xfs_efi_item_size,
  239. .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
  240. xfs_efi_item_format,
  241. .iop_pin = (void(*)(xfs_log_item_t*))xfs_efi_item_pin,
  242. .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_efi_item_unpin,
  243. .iop_unpin_remove = (void(*)(xfs_log_item_t*, xfs_trans_t *))
  244. xfs_efi_item_unpin_remove,
  245. .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_efi_item_trylock,
  246. .iop_unlock = (void(*)(xfs_log_item_t*))xfs_efi_item_unlock,
  247. .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t))
  248. xfs_efi_item_committed,
  249. .iop_push = (void(*)(xfs_log_item_t*))xfs_efi_item_push,
  250. .iop_abort = (void(*)(xfs_log_item_t*))xfs_efi_item_abort,
  251. .iop_pushbuf = NULL,
  252. .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t))
  253. xfs_efi_item_committing
  254. };
  255. /*
  256. * Allocate and initialize an efi item with the given number of extents.
  257. */
  258. xfs_efi_log_item_t *
  259. xfs_efi_init(xfs_mount_t *mp,
  260. uint nextents)
  261. {
  262. xfs_efi_log_item_t *efip;
  263. uint size;
  264. ASSERT(nextents > 0);
  265. if (nextents > XFS_EFI_MAX_FAST_EXTENTS) {
  266. size = (uint)(sizeof(xfs_efi_log_item_t) +
  267. ((nextents - 1) * sizeof(xfs_extent_t)));
  268. efip = (xfs_efi_log_item_t*)kmem_zalloc(size, KM_SLEEP);
  269. } else {
  270. efip = (xfs_efi_log_item_t*)kmem_zone_zalloc(xfs_efi_zone,
  271. KM_SLEEP);
  272. }
  273. efip->efi_item.li_type = XFS_LI_EFI;
  274. efip->efi_item.li_ops = &xfs_efi_item_ops;
  275. efip->efi_item.li_mountp = mp;
  276. efip->efi_format.efi_nextents = nextents;
  277. efip->efi_format.efi_id = (__psint_t)(void*)efip;
  278. return (efip);
  279. }
  280. /*
  281. * This is called by the efd item code below to release references to
  282. * the given efi item. Each efd calls this with the number of
  283. * extents that it has logged, and when the sum of these reaches
  284. * the total number of extents logged by this efi item we can free
  285. * the efi item.
  286. *
  287. * Freeing the efi item requires that we remove it from the AIL.
  288. * We'll use the AIL lock to protect our counters as well as
  289. * the removal from the AIL.
  290. */
  291. void
  292. xfs_efi_release(xfs_efi_log_item_t *efip,
  293. uint nextents)
  294. {
  295. xfs_mount_t *mp;
  296. int extents_left;
  297. SPLDECL(s);
  298. mp = efip->efi_item.li_mountp;
  299. ASSERT(efip->efi_next_extent > 0);
  300. ASSERT(efip->efi_flags & XFS_EFI_COMMITTED);
  301. AIL_LOCK(mp, s);
  302. ASSERT(efip->efi_next_extent >= nextents);
  303. efip->efi_next_extent -= nextents;
  304. extents_left = efip->efi_next_extent;
  305. if (extents_left == 0) {
  306. /*
  307. * xfs_trans_delete_ail() drops the AIL lock.
  308. */
  309. xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s);
  310. xfs_efi_item_free(efip);
  311. } else {
  312. AIL_UNLOCK(mp, s);
  313. }
  314. }
  315. /*
  316. * This is called when the transaction that should be committing the
  317. * EFD corresponding to the given EFI is aborted. The committed and
  318. * canceled flags are used to coordinate the freeing of the EFI and
  319. * the references by the transaction that committed it.
  320. */
  321. STATIC void
  322. xfs_efi_cancel(
  323. xfs_efi_log_item_t *efip)
  324. {
  325. xfs_mount_t *mp;
  326. SPLDECL(s);
  327. mp = efip->efi_item.li_mountp;
  328. AIL_LOCK(mp, s);
  329. if (efip->efi_flags & XFS_EFI_COMMITTED) {
  330. /*
  331. * xfs_trans_delete_ail() drops the AIL lock.
  332. */
  333. xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s);
  334. xfs_efi_item_free(efip);
  335. } else {
  336. efip->efi_flags |= XFS_EFI_CANCELED;
  337. AIL_UNLOCK(mp, s);
  338. }
  339. }
  340. STATIC void
  341. xfs_efd_item_free(xfs_efd_log_item_t *efdp)
  342. {
  343. int nexts = efdp->efd_format.efd_nextents;
  344. if (nexts > XFS_EFD_MAX_FAST_EXTENTS) {
  345. kmem_free(efdp, sizeof(xfs_efd_log_item_t) +
  346. (nexts - 1) * sizeof(xfs_extent_t));
  347. } else {
  348. kmem_zone_free(xfs_efd_zone, efdp);
  349. }
  350. }
  351. /*
  352. * This returns the number of iovecs needed to log the given efd item.
  353. * We only need 1 iovec for an efd item. It just logs the efd_log_format
  354. * structure.
  355. */
  356. /*ARGSUSED*/
  357. STATIC uint
  358. xfs_efd_item_size(xfs_efd_log_item_t *efdp)
  359. {
  360. return 1;
  361. }
  362. /*
  363. * This is called to fill in the vector of log iovecs for the
  364. * given efd log item. We use only 1 iovec, and we point that
  365. * at the efd_log_format structure embedded in the efd item.
  366. * It is at this point that we assert that all of the extent
  367. * slots in the efd item have been filled.
  368. */
  369. STATIC void
  370. xfs_efd_item_format(xfs_efd_log_item_t *efdp,
  371. xfs_log_iovec_t *log_vector)
  372. {
  373. uint size;
  374. ASSERT(efdp->efd_next_extent == efdp->efd_format.efd_nextents);
  375. efdp->efd_format.efd_type = XFS_LI_EFD;
  376. size = sizeof(xfs_efd_log_format_t);
  377. size += (efdp->efd_format.efd_nextents - 1) * sizeof(xfs_extent_t);
  378. efdp->efd_format.efd_size = 1;
  379. log_vector->i_addr = (xfs_caddr_t)&(efdp->efd_format);
  380. log_vector->i_len = size;
  381. ASSERT(size >= sizeof(xfs_efd_log_format_t));
  382. }
  383. /*
  384. * Pinning has no meaning for an efd item, so just return.
  385. */
  386. /*ARGSUSED*/
  387. STATIC void
  388. xfs_efd_item_pin(xfs_efd_log_item_t *efdp)
  389. {
  390. return;
  391. }
  392. /*
  393. * Since pinning has no meaning for an efd item, unpinning does
  394. * not either.
  395. */
  396. /*ARGSUSED*/
  397. STATIC void
  398. xfs_efd_item_unpin(xfs_efd_log_item_t *efdp, int stale)
  399. {
  400. return;
  401. }
  402. /*ARGSUSED*/
  403. STATIC void
  404. xfs_efd_item_unpin_remove(xfs_efd_log_item_t *efdp, xfs_trans_t *tp)
  405. {
  406. return;
  407. }
  408. /*
  409. * Efd items have no locking, so just return success.
  410. */
  411. /*ARGSUSED*/
  412. STATIC uint
  413. xfs_efd_item_trylock(xfs_efd_log_item_t *efdp)
  414. {
  415. return XFS_ITEM_LOCKED;
  416. }
  417. /*
  418. * Efd items have no locking or pushing, so return failure
  419. * so that the caller doesn't bother with us.
  420. */
  421. /*ARGSUSED*/
  422. STATIC void
  423. xfs_efd_item_unlock(xfs_efd_log_item_t *efdp)
  424. {
  425. if (efdp->efd_item.li_flags & XFS_LI_ABORTED)
  426. xfs_efd_item_abort(efdp);
  427. return;
  428. }
  429. /*
  430. * When the efd item is committed to disk, all we need to do
  431. * is delete our reference to our partner efi item and then
  432. * free ourselves. Since we're freeing ourselves we must
  433. * return -1 to keep the transaction code from further referencing
  434. * this item.
  435. */
  436. /*ARGSUSED*/
  437. STATIC xfs_lsn_t
  438. xfs_efd_item_committed(xfs_efd_log_item_t *efdp, xfs_lsn_t lsn)
  439. {
  440. /*
  441. * If we got a log I/O error, it's always the case that the LR with the
  442. * EFI got unpinned and freed before the EFD got aborted.
  443. */
  444. if ((efdp->efd_item.li_flags & XFS_LI_ABORTED) == 0)
  445. xfs_efi_release(efdp->efd_efip, efdp->efd_format.efd_nextents);
  446. xfs_efd_item_free(efdp);
  447. return (xfs_lsn_t)-1;
  448. }
  449. /*
  450. * The transaction of which this EFD is a part has been aborted.
  451. * Inform its companion EFI of this fact and then clean up after
  452. * ourselves. No need to clean up the slot for the item in the
  453. * transaction. That was done by the unpin code which is called
  454. * prior to this routine in the abort/fs-shutdown path.
  455. */
  456. STATIC void
  457. xfs_efd_item_abort(xfs_efd_log_item_t *efdp)
  458. {
  459. /*
  460. * If we got a log I/O error, it's always the case that the LR with the
  461. * EFI got unpinned and freed before the EFD got aborted. So don't
  462. * reference the EFI at all in that case.
  463. */
  464. if ((efdp->efd_item.li_flags & XFS_LI_ABORTED) == 0)
  465. xfs_efi_cancel(efdp->efd_efip);
  466. xfs_efd_item_free(efdp);
  467. }
  468. /*
  469. * There isn't much you can do to push on an efd item. It is simply
  470. * stuck waiting for the log to be flushed to disk.
  471. */
  472. /*ARGSUSED*/
  473. STATIC void
  474. xfs_efd_item_push(xfs_efd_log_item_t *efdp)
  475. {
  476. return;
  477. }
  478. /*
  479. * The EFD dependency tracking op doesn't do squat. It can't because
  480. * it doesn't know where the free extent is coming from. The dependency
  481. * tracking has to be handled by the "enclosing" metadata object. For
  482. * example, for inodes, the inode is locked throughout the extent freeing
  483. * so the dependency should be recorded there.
  484. */
  485. /*ARGSUSED*/
  486. STATIC void
  487. xfs_efd_item_committing(xfs_efd_log_item_t *efip, xfs_lsn_t lsn)
  488. {
  489. return;
  490. }
  491. /*
  492. * This is the ops vector shared by all efd log items.
  493. */
  494. STATIC struct xfs_item_ops xfs_efd_item_ops = {
  495. .iop_size = (uint(*)(xfs_log_item_t*))xfs_efd_item_size,
  496. .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
  497. xfs_efd_item_format,
  498. .iop_pin = (void(*)(xfs_log_item_t*))xfs_efd_item_pin,
  499. .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_efd_item_unpin,
  500. .iop_unpin_remove = (void(*)(xfs_log_item_t*, xfs_trans_t*))
  501. xfs_efd_item_unpin_remove,
  502. .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_efd_item_trylock,
  503. .iop_unlock = (void(*)(xfs_log_item_t*))xfs_efd_item_unlock,
  504. .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t))
  505. xfs_efd_item_committed,
  506. .iop_push = (void(*)(xfs_log_item_t*))xfs_efd_item_push,
  507. .iop_abort = (void(*)(xfs_log_item_t*))xfs_efd_item_abort,
  508. .iop_pushbuf = NULL,
  509. .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t))
  510. xfs_efd_item_committing
  511. };
  512. /*
  513. * Allocate and initialize an efd item with the given number of extents.
  514. */
  515. xfs_efd_log_item_t *
  516. xfs_efd_init(xfs_mount_t *mp,
  517. xfs_efi_log_item_t *efip,
  518. uint nextents)
  519. {
  520. xfs_efd_log_item_t *efdp;
  521. uint size;
  522. ASSERT(nextents > 0);
  523. if (nextents > XFS_EFD_MAX_FAST_EXTENTS) {
  524. size = (uint)(sizeof(xfs_efd_log_item_t) +
  525. ((nextents - 1) * sizeof(xfs_extent_t)));
  526. efdp = (xfs_efd_log_item_t*)kmem_zalloc(size, KM_SLEEP);
  527. } else {
  528. efdp = (xfs_efd_log_item_t*)kmem_zone_zalloc(xfs_efd_zone,
  529. KM_SLEEP);
  530. }
  531. efdp->efd_item.li_type = XFS_LI_EFD;
  532. efdp->efd_item.li_ops = &xfs_efd_item_ops;
  533. efdp->efd_item.li_mountp = mp;
  534. efdp->efd_efip = efip;
  535. efdp->efd_format.efd_nextents = nextents;
  536. efdp->efd_format.efd_efi_id = efip->efi_format.efi_id;
  537. return (efdp);
  538. }