xfs_extfree_item.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  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. XLOG_VEC_SET_TYPE(log_vector, XLOG_REG_TYPE_EFI_FORMAT);
  96. ASSERT(size >= sizeof(xfs_efi_log_format_t));
  97. }
  98. /*
  99. * Pinning has no meaning for an efi item, so just return.
  100. */
  101. /*ARGSUSED*/
  102. STATIC void
  103. xfs_efi_item_pin(xfs_efi_log_item_t *efip)
  104. {
  105. return;
  106. }
  107. /*
  108. * While EFIs cannot really be pinned, the unpin operation is the
  109. * last place at which the EFI is manipulated during a transaction.
  110. * Here we coordinate with xfs_efi_cancel() to determine who gets to
  111. * free the EFI.
  112. */
  113. /*ARGSUSED*/
  114. STATIC void
  115. xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale)
  116. {
  117. xfs_mount_t *mp;
  118. SPLDECL(s);
  119. mp = efip->efi_item.li_mountp;
  120. AIL_LOCK(mp, s);
  121. if (efip->efi_flags & XFS_EFI_CANCELED) {
  122. /*
  123. * xfs_trans_delete_ail() drops the AIL lock.
  124. */
  125. xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s);
  126. xfs_efi_item_free(efip);
  127. } else {
  128. efip->efi_flags |= XFS_EFI_COMMITTED;
  129. AIL_UNLOCK(mp, s);
  130. }
  131. }
  132. /*
  133. * like unpin only we have to also clear the xaction descriptor
  134. * pointing the log item if we free the item. This routine duplicates
  135. * unpin because efi_flags is protected by the AIL lock. Freeing
  136. * the descriptor and then calling unpin would force us to drop the AIL
  137. * lock which would open up a race condition.
  138. */
  139. STATIC void
  140. xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp)
  141. {
  142. xfs_mount_t *mp;
  143. xfs_log_item_desc_t *lidp;
  144. SPLDECL(s);
  145. mp = efip->efi_item.li_mountp;
  146. AIL_LOCK(mp, s);
  147. if (efip->efi_flags & XFS_EFI_CANCELED) {
  148. /*
  149. * free the xaction descriptor pointing to this item
  150. */
  151. lidp = xfs_trans_find_item(tp, (xfs_log_item_t *) efip);
  152. xfs_trans_free_item(tp, lidp);
  153. /*
  154. * pull the item off the AIL.
  155. * xfs_trans_delete_ail() drops the AIL lock.
  156. */
  157. xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s);
  158. xfs_efi_item_free(efip);
  159. } else {
  160. efip->efi_flags |= XFS_EFI_COMMITTED;
  161. AIL_UNLOCK(mp, s);
  162. }
  163. }
  164. /*
  165. * Efi items have no locking or pushing. However, since EFIs are
  166. * pulled from the AIL when their corresponding EFDs are committed
  167. * to disk, their situation is very similar to being pinned. Return
  168. * XFS_ITEM_PINNED so that the caller will eventually flush the log.
  169. * This should help in getting the EFI out of the AIL.
  170. */
  171. /*ARGSUSED*/
  172. STATIC uint
  173. xfs_efi_item_trylock(xfs_efi_log_item_t *efip)
  174. {
  175. return XFS_ITEM_PINNED;
  176. }
  177. /*
  178. * Efi items have no locking, so just return.
  179. */
  180. /*ARGSUSED*/
  181. STATIC void
  182. xfs_efi_item_unlock(xfs_efi_log_item_t *efip)
  183. {
  184. if (efip->efi_item.li_flags & XFS_LI_ABORTED)
  185. xfs_efi_item_abort(efip);
  186. return;
  187. }
  188. /*
  189. * The EFI is logged only once and cannot be moved in the log, so
  190. * simply return the lsn at which it's been logged. The canceled
  191. * flag is not paid any attention here. Checking for that is delayed
  192. * until the EFI is unpinned.
  193. */
  194. /*ARGSUSED*/
  195. STATIC xfs_lsn_t
  196. xfs_efi_item_committed(xfs_efi_log_item_t *efip, xfs_lsn_t lsn)
  197. {
  198. return lsn;
  199. }
  200. /*
  201. * This is called when the transaction logging the EFI is aborted.
  202. * Free up the EFI and return. No need to clean up the slot for
  203. * the item in the transaction. That was done by the unpin code
  204. * which is called prior to this routine in the abort/fs-shutdown path.
  205. */
  206. STATIC void
  207. xfs_efi_item_abort(xfs_efi_log_item_t *efip)
  208. {
  209. xfs_efi_item_free(efip);
  210. }
  211. /*
  212. * There isn't much you can do to push on an efi item. It is simply
  213. * stuck waiting for all of its corresponding efd items to be
  214. * committed to disk.
  215. */
  216. /*ARGSUSED*/
  217. STATIC void
  218. xfs_efi_item_push(xfs_efi_log_item_t *efip)
  219. {
  220. return;
  221. }
  222. /*
  223. * The EFI dependency tracking op doesn't do squat. It can't because
  224. * it doesn't know where the free extent is coming from. The dependency
  225. * tracking has to be handled by the "enclosing" metadata object. For
  226. * example, for inodes, the inode is locked throughout the extent freeing
  227. * so the dependency should be recorded there.
  228. */
  229. /*ARGSUSED*/
  230. STATIC void
  231. xfs_efi_item_committing(xfs_efi_log_item_t *efip, xfs_lsn_t lsn)
  232. {
  233. return;
  234. }
  235. /*
  236. * This is the ops vector shared by all efi log items.
  237. */
  238. STATIC struct xfs_item_ops xfs_efi_item_ops = {
  239. .iop_size = (uint(*)(xfs_log_item_t*))xfs_efi_item_size,
  240. .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
  241. xfs_efi_item_format,
  242. .iop_pin = (void(*)(xfs_log_item_t*))xfs_efi_item_pin,
  243. .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_efi_item_unpin,
  244. .iop_unpin_remove = (void(*)(xfs_log_item_t*, xfs_trans_t *))
  245. xfs_efi_item_unpin_remove,
  246. .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_efi_item_trylock,
  247. .iop_unlock = (void(*)(xfs_log_item_t*))xfs_efi_item_unlock,
  248. .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t))
  249. xfs_efi_item_committed,
  250. .iop_push = (void(*)(xfs_log_item_t*))xfs_efi_item_push,
  251. .iop_abort = (void(*)(xfs_log_item_t*))xfs_efi_item_abort,
  252. .iop_pushbuf = NULL,
  253. .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t))
  254. xfs_efi_item_committing
  255. };
  256. /*
  257. * Allocate and initialize an efi item with the given number of extents.
  258. */
  259. xfs_efi_log_item_t *
  260. xfs_efi_init(xfs_mount_t *mp,
  261. uint nextents)
  262. {
  263. xfs_efi_log_item_t *efip;
  264. uint size;
  265. ASSERT(nextents > 0);
  266. if (nextents > XFS_EFI_MAX_FAST_EXTENTS) {
  267. size = (uint)(sizeof(xfs_efi_log_item_t) +
  268. ((nextents - 1) * sizeof(xfs_extent_t)));
  269. efip = (xfs_efi_log_item_t*)kmem_zalloc(size, KM_SLEEP);
  270. } else {
  271. efip = (xfs_efi_log_item_t*)kmem_zone_zalloc(xfs_efi_zone,
  272. KM_SLEEP);
  273. }
  274. efip->efi_item.li_type = XFS_LI_EFI;
  275. efip->efi_item.li_ops = &xfs_efi_item_ops;
  276. efip->efi_item.li_mountp = mp;
  277. efip->efi_format.efi_nextents = nextents;
  278. efip->efi_format.efi_id = (__psint_t)(void*)efip;
  279. return (efip);
  280. }
  281. /*
  282. * This is called by the efd item code below to release references to
  283. * the given efi item. Each efd calls this with the number of
  284. * extents that it has logged, and when the sum of these reaches
  285. * the total number of extents logged by this efi item we can free
  286. * the efi item.
  287. *
  288. * Freeing the efi item requires that we remove it from the AIL.
  289. * We'll use the AIL lock to protect our counters as well as
  290. * the removal from the AIL.
  291. */
  292. void
  293. xfs_efi_release(xfs_efi_log_item_t *efip,
  294. uint nextents)
  295. {
  296. xfs_mount_t *mp;
  297. int extents_left;
  298. SPLDECL(s);
  299. mp = efip->efi_item.li_mountp;
  300. ASSERT(efip->efi_next_extent > 0);
  301. ASSERT(efip->efi_flags & XFS_EFI_COMMITTED);
  302. AIL_LOCK(mp, s);
  303. ASSERT(efip->efi_next_extent >= nextents);
  304. efip->efi_next_extent -= nextents;
  305. extents_left = efip->efi_next_extent;
  306. if (extents_left == 0) {
  307. /*
  308. * xfs_trans_delete_ail() drops the AIL lock.
  309. */
  310. xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s);
  311. xfs_efi_item_free(efip);
  312. } else {
  313. AIL_UNLOCK(mp, s);
  314. }
  315. }
  316. /*
  317. * This is called when the transaction that should be committing the
  318. * EFD corresponding to the given EFI is aborted. The committed and
  319. * canceled flags are used to coordinate the freeing of the EFI and
  320. * the references by the transaction that committed it.
  321. */
  322. STATIC void
  323. xfs_efi_cancel(
  324. xfs_efi_log_item_t *efip)
  325. {
  326. xfs_mount_t *mp;
  327. SPLDECL(s);
  328. mp = efip->efi_item.li_mountp;
  329. AIL_LOCK(mp, s);
  330. if (efip->efi_flags & XFS_EFI_COMMITTED) {
  331. /*
  332. * xfs_trans_delete_ail() drops the AIL lock.
  333. */
  334. xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s);
  335. xfs_efi_item_free(efip);
  336. } else {
  337. efip->efi_flags |= XFS_EFI_CANCELED;
  338. AIL_UNLOCK(mp, s);
  339. }
  340. }
  341. STATIC void
  342. xfs_efd_item_free(xfs_efd_log_item_t *efdp)
  343. {
  344. int nexts = efdp->efd_format.efd_nextents;
  345. if (nexts > XFS_EFD_MAX_FAST_EXTENTS) {
  346. kmem_free(efdp, sizeof(xfs_efd_log_item_t) +
  347. (nexts - 1) * sizeof(xfs_extent_t));
  348. } else {
  349. kmem_zone_free(xfs_efd_zone, efdp);
  350. }
  351. }
  352. /*
  353. * This returns the number of iovecs needed to log the given efd item.
  354. * We only need 1 iovec for an efd item. It just logs the efd_log_format
  355. * structure.
  356. */
  357. /*ARGSUSED*/
  358. STATIC uint
  359. xfs_efd_item_size(xfs_efd_log_item_t *efdp)
  360. {
  361. return 1;
  362. }
  363. /*
  364. * This is called to fill in the vector of log iovecs for the
  365. * given efd log item. We use only 1 iovec, and we point that
  366. * at the efd_log_format structure embedded in the efd item.
  367. * It is at this point that we assert that all of the extent
  368. * slots in the efd item have been filled.
  369. */
  370. STATIC void
  371. xfs_efd_item_format(xfs_efd_log_item_t *efdp,
  372. xfs_log_iovec_t *log_vector)
  373. {
  374. uint size;
  375. ASSERT(efdp->efd_next_extent == efdp->efd_format.efd_nextents);
  376. efdp->efd_format.efd_type = XFS_LI_EFD;
  377. size = sizeof(xfs_efd_log_format_t);
  378. size += (efdp->efd_format.efd_nextents - 1) * sizeof(xfs_extent_t);
  379. efdp->efd_format.efd_size = 1;
  380. log_vector->i_addr = (xfs_caddr_t)&(efdp->efd_format);
  381. log_vector->i_len = size;
  382. XLOG_VEC_SET_TYPE(log_vector, XLOG_REG_TYPE_EFD_FORMAT);
  383. ASSERT(size >= sizeof(xfs_efd_log_format_t));
  384. }
  385. /*
  386. * Pinning has no meaning for an efd item, so just return.
  387. */
  388. /*ARGSUSED*/
  389. STATIC void
  390. xfs_efd_item_pin(xfs_efd_log_item_t *efdp)
  391. {
  392. return;
  393. }
  394. /*
  395. * Since pinning has no meaning for an efd item, unpinning does
  396. * not either.
  397. */
  398. /*ARGSUSED*/
  399. STATIC void
  400. xfs_efd_item_unpin(xfs_efd_log_item_t *efdp, int stale)
  401. {
  402. return;
  403. }
  404. /*ARGSUSED*/
  405. STATIC void
  406. xfs_efd_item_unpin_remove(xfs_efd_log_item_t *efdp, xfs_trans_t *tp)
  407. {
  408. return;
  409. }
  410. /*
  411. * Efd items have no locking, so just return success.
  412. */
  413. /*ARGSUSED*/
  414. STATIC uint
  415. xfs_efd_item_trylock(xfs_efd_log_item_t *efdp)
  416. {
  417. return XFS_ITEM_LOCKED;
  418. }
  419. /*
  420. * Efd items have no locking or pushing, so return failure
  421. * so that the caller doesn't bother with us.
  422. */
  423. /*ARGSUSED*/
  424. STATIC void
  425. xfs_efd_item_unlock(xfs_efd_log_item_t *efdp)
  426. {
  427. if (efdp->efd_item.li_flags & XFS_LI_ABORTED)
  428. xfs_efd_item_abort(efdp);
  429. return;
  430. }
  431. /*
  432. * When the efd item is committed to disk, all we need to do
  433. * is delete our reference to our partner efi item and then
  434. * free ourselves. Since we're freeing ourselves we must
  435. * return -1 to keep the transaction code from further referencing
  436. * this item.
  437. */
  438. /*ARGSUSED*/
  439. STATIC xfs_lsn_t
  440. xfs_efd_item_committed(xfs_efd_log_item_t *efdp, xfs_lsn_t lsn)
  441. {
  442. /*
  443. * If we got a log I/O error, it's always the case that the LR with the
  444. * EFI got unpinned and freed before the EFD got aborted.
  445. */
  446. if ((efdp->efd_item.li_flags & XFS_LI_ABORTED) == 0)
  447. xfs_efi_release(efdp->efd_efip, efdp->efd_format.efd_nextents);
  448. xfs_efd_item_free(efdp);
  449. return (xfs_lsn_t)-1;
  450. }
  451. /*
  452. * The transaction of which this EFD is a part has been aborted.
  453. * Inform its companion EFI of this fact and then clean up after
  454. * ourselves. No need to clean up the slot for the item in the
  455. * transaction. That was done by the unpin code which is called
  456. * prior to this routine in the abort/fs-shutdown path.
  457. */
  458. STATIC void
  459. xfs_efd_item_abort(xfs_efd_log_item_t *efdp)
  460. {
  461. /*
  462. * If we got a log I/O error, it's always the case that the LR with the
  463. * EFI got unpinned and freed before the EFD got aborted. So don't
  464. * reference the EFI at all in that case.
  465. */
  466. if ((efdp->efd_item.li_flags & XFS_LI_ABORTED) == 0)
  467. xfs_efi_cancel(efdp->efd_efip);
  468. xfs_efd_item_free(efdp);
  469. }
  470. /*
  471. * There isn't much you can do to push on an efd item. It is simply
  472. * stuck waiting for the log to be flushed to disk.
  473. */
  474. /*ARGSUSED*/
  475. STATIC void
  476. xfs_efd_item_push(xfs_efd_log_item_t *efdp)
  477. {
  478. return;
  479. }
  480. /*
  481. * The EFD dependency tracking op doesn't do squat. It can't because
  482. * it doesn't know where the free extent is coming from. The dependency
  483. * tracking has to be handled by the "enclosing" metadata object. For
  484. * example, for inodes, the inode is locked throughout the extent freeing
  485. * so the dependency should be recorded there.
  486. */
  487. /*ARGSUSED*/
  488. STATIC void
  489. xfs_efd_item_committing(xfs_efd_log_item_t *efip, xfs_lsn_t lsn)
  490. {
  491. return;
  492. }
  493. /*
  494. * This is the ops vector shared by all efd log items.
  495. */
  496. STATIC struct xfs_item_ops xfs_efd_item_ops = {
  497. .iop_size = (uint(*)(xfs_log_item_t*))xfs_efd_item_size,
  498. .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
  499. xfs_efd_item_format,
  500. .iop_pin = (void(*)(xfs_log_item_t*))xfs_efd_item_pin,
  501. .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_efd_item_unpin,
  502. .iop_unpin_remove = (void(*)(xfs_log_item_t*, xfs_trans_t*))
  503. xfs_efd_item_unpin_remove,
  504. .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_efd_item_trylock,
  505. .iop_unlock = (void(*)(xfs_log_item_t*))xfs_efd_item_unlock,
  506. .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t))
  507. xfs_efd_item_committed,
  508. .iop_push = (void(*)(xfs_log_item_t*))xfs_efd_item_push,
  509. .iop_abort = (void(*)(xfs_log_item_t*))xfs_efd_item_abort,
  510. .iop_pushbuf = NULL,
  511. .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t))
  512. xfs_efd_item_committing
  513. };
  514. /*
  515. * Allocate and initialize an efd item with the given number of extents.
  516. */
  517. xfs_efd_log_item_t *
  518. xfs_efd_init(xfs_mount_t *mp,
  519. xfs_efi_log_item_t *efip,
  520. uint nextents)
  521. {
  522. xfs_efd_log_item_t *efdp;
  523. uint size;
  524. ASSERT(nextents > 0);
  525. if (nextents > XFS_EFD_MAX_FAST_EXTENTS) {
  526. size = (uint)(sizeof(xfs_efd_log_item_t) +
  527. ((nextents - 1) * sizeof(xfs_extent_t)));
  528. efdp = (xfs_efd_log_item_t*)kmem_zalloc(size, KM_SLEEP);
  529. } else {
  530. efdp = (xfs_efd_log_item_t*)kmem_zone_zalloc(xfs_efd_zone,
  531. KM_SLEEP);
  532. }
  533. efdp->efd_item.li_type = XFS_LI_EFD;
  534. efdp->efd_item.li_ops = &xfs_efd_item_ops;
  535. efdp->efd_item.li_mountp = mp;
  536. efdp->efd_efip = efip;
  537. efdp->efd_format.efd_nextents = nextents;
  538. efdp->efd_format.efd_efi_id = efip->efi_format.efi_id;
  539. return (efdp);
  540. }