2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "libxfs_priv.h"
24 #include "xfs_shared.h"
25 #include "xfs_format.h"
26 #include "xfs_log_format.h"
27 #include "xfs_trans_resv.h"
28 #include "xfs_mount.h"
29 #include "xfs_inode_buf.h"
30 #include "xfs_inode_fork.h"
31 #include "xfs_inode.h"
32 #include "xfs_trans.h"
34 #include "libxfs.h" /* for now */
36 char *progname
= "libxfs"; /* default, changed by each tool */
38 struct cache
*libxfs_bcache
; /* global buffer cache */
39 int libxfs_bhash_size
; /* #buckets in bcache */
41 int use_xfs_buf_lock
; /* global flag: use xfs_buf_t locks for MT */
43 static void manage_zones(int); /* setup global zones */
45 kmem_zone_t
*xfs_inode_zone
;
48 * dev_map - map open devices to fd.
50 #define MAX_DEVS 10 /* arbitary maximum */
51 int nextfakedev
= -1; /* device number to give to next fake device */
52 static struct dev_to_fd
{
55 } dev_map
[MAX_DEVS
]={{0}};
58 * Checks whether a given device has a mounted, writable
59 * filesystem, returns 1 if it does & fatal (just warns
60 * if not fatal, but allows us to proceed).
62 * Useful to tools which will produce uncertain results
63 * if the filesystem is active - repair, check, logprint.
66 check_isactive(char *name
, char *block
, int fatal
)
70 if (stat64(block
, &st
) < 0)
72 if ((st
.st_mode
& S_IFMT
) != S_IFBLK
)
74 if (platform_check_ismounted(name
, block
, &st
, 0) == 0)
76 return platform_check_iswritable(name
, block
, &st
, fatal
);
79 /* libxfs_device_to_fd:
80 * lookup a device number in the device map
81 * return the associated fd
84 libxfs_device_to_fd(dev_t device
)
88 for (d
= 0; d
< MAX_DEVS
; d
++)
89 if (dev_map
[d
].dev
== device
)
92 fprintf(stderr
, _("%s: %s: device %lld is not open\n"),
93 progname
, __FUNCTION__
, (long long)device
);
98 /* libxfs_device_open:
99 * open a device and return its device number
102 libxfs_device_open(char *path
, int creat
, int xflags
, int setblksize
)
106 int readonly
, dio
, excl
;
109 readonly
= (xflags
& LIBXFS_ISREADONLY
);
110 excl
= (xflags
& LIBXFS_EXCLUSIVELY
) && !creat
;
111 dio
= (xflags
& LIBXFS_DIRECT
) && !creat
&& platform_direct_blockdev();
114 flags
= (readonly
? O_RDONLY
: O_RDWR
) | \
115 (creat
? (O_CREAT
|O_TRUNC
) : 0) | \
116 (dio
? O_DIRECT
: 0) | \
119 if ((fd
= open(path
, flags
, 0666)) < 0) {
120 if (errno
== EINVAL
&& --dio
== 0)
122 fprintf(stderr
, _("%s: cannot open %s: %s\n"),
123 progname
, path
, strerror(errno
));
127 if (fstat64(fd
, &statb
) < 0) {
128 fprintf(stderr
, _("%s: cannot stat %s: %s\n"),
129 progname
, path
, strerror(errno
));
133 if (!readonly
&& setblksize
&& (statb
.st_mode
& S_IFMT
) == S_IFBLK
) {
135 /* use the default blocksize */
136 (void)platform_set_blocksize(fd
, path
, statb
.st_rdev
, XFS_MIN_SECTORSIZE
, 0);
138 /* given an explicit blocksize to use */
139 if (platform_set_blocksize(fd
, path
, statb
.st_rdev
, setblksize
, 1))
145 * Get the device number from the stat buf - unless
146 * we're not opening a real device, in which case
147 * choose a new fake device number.
149 dev
= (statb
.st_rdev
) ? (statb
.st_rdev
) : (nextfakedev
--);
151 for (d
= 0; d
< MAX_DEVS
; d
++)
152 if (dev_map
[d
].dev
== dev
) {
153 fprintf(stderr
, _("%s: device %lld is already open\n"),
154 progname
, (long long)dev
);
158 for (d
= 0; d
< MAX_DEVS
; d
++)
159 if (!dev_map
[d
].dev
) {
160 dev_map
[d
].dev
= dev
;
166 fprintf(stderr
, _("%s: %s: too many open devices\n"),
167 progname
, __FUNCTION__
);
173 libxfs_device_close(dev_t dev
)
177 for (d
= 0; d
< MAX_DEVS
; d
++)
178 if (dev_map
[d
].dev
== dev
) {
182 dev_map
[d
].dev
= dev_map
[d
].fd
= 0;
185 platform_flush_device(fd
, dev
);
191 fprintf(stderr
, _("%s: %s: device %lld is not open\n"),
192 progname
, __FUNCTION__
, (long long)dev
);
197 check_open(char *path
, int flags
, char **rawfile
, char **blockfile
)
199 int readonly
= (flags
& LIBXFS_ISREADONLY
);
200 int inactive
= (flags
& LIBXFS_ISINACTIVE
);
201 int dangerously
= (flags
& LIBXFS_DANGEROUSLY
);
204 if (stat64(path
, &stbuf
) < 0) {
208 if (!(*rawfile
= platform_findrawpath(path
))) {
209 fprintf(stderr
, _("%s: "
210 "can't find a character device matching %s\n"),
214 if (!(*blockfile
= platform_findblockpath(path
))) {
215 fprintf(stderr
, _("%s: "
216 "can't find a block device matching %s\n"),
220 if (!readonly
&& !inactive
&& platform_check_ismounted(path
, *blockfile
, NULL
, 1))
223 if (inactive
&& check_isactive(path
, *blockfile
, ((readonly
|dangerously
)?1:0)))
230 * libxfs initialization.
231 * Caller gets a 0 on failure (and we print a message), 1 on success.
234 libxfs_init(libxfs_init_t
*a
)
237 char curdir
[MAXPATHLEN
];
250 dpath
[0] = logpath
[0] = rtpath
[0] = '\0';
252 logname
= a
->logname
;
254 a
->dfd
= a
->logfd
= a
->rtfd
= -1;
255 a
->ddev
= a
->logdev
= a
->rtdev
= 0;
256 a
->dbsize
= a
->lbsize
= a
->rtbsize
= 0;
257 a
->dsize
= a
->logBBsize
= a
->logBBstart
= a
->rtsize
= 0;
259 (void)getcwd(curdir
,MAXPATHLEN
);
262 flags
= (a
->isreadonly
| a
->isdirect
);
267 if(!check_open(a
->volname
,flags
,&rawfile
,&blockfile
))
270 fd
= open(rawfile
, O_RDONLY
);
271 dname
= a
->dname
= a
->volname
;
275 if (dname
[0] != '/' && needcd
)
278 a
->ddev
= libxfs_device_open(dname
, a
->dcreat
, flags
,
280 a
->dfd
= libxfs_device_to_fd(a
->ddev
);
282 if (!check_open(dname
, flags
, &rawfile
, &blockfile
))
284 a
->ddev
= libxfs_device_open(rawfile
,
285 a
->dcreat
, flags
, a
->setblksize
);
286 a
->dfd
= libxfs_device_to_fd(a
->ddev
);
287 platform_findsizes(rawfile
, a
->dfd
,
288 &a
->dsize
, &a
->dbsize
);
294 if (logname
[0] != '/' && needcd
)
297 a
->logdev
= libxfs_device_open(logname
,
298 a
->lcreat
, flags
, a
->setblksize
);
299 a
->logfd
= libxfs_device_to_fd(a
->logdev
);
301 if (!check_open(logname
, flags
, &rawfile
, &blockfile
))
303 a
->logdev
= libxfs_device_open(rawfile
,
304 a
->lcreat
, flags
, a
->setblksize
);
305 a
->logfd
= libxfs_device_to_fd(a
->logdev
);
306 platform_findsizes(rawfile
, a
->logfd
,
307 &a
->logBBsize
, &a
->lbsize
);
313 if (rtname
[0] != '/' && needcd
)
316 a
->rtdev
= libxfs_device_open(rtname
,
317 a
->rcreat
, flags
, a
->setblksize
);
318 a
->rtfd
= libxfs_device_to_fd(a
->rtdev
);
320 if (!check_open(rtname
, flags
, &rawfile
, &blockfile
))
322 a
->rtdev
= libxfs_device_open(rawfile
,
323 a
->rcreat
, flags
, a
->setblksize
);
324 a
->rtfd
= libxfs_device_to_fd(a
->rtdev
);
325 platform_findsizes(rawfile
, a
->rtfd
,
326 &a
->rtsize
, &a
->rtbsize
);
332 fprintf(stderr
, _("%s: can't get size for data subvolume\n"),
336 if (a
->logBBsize
< 0) {
337 fprintf(stderr
, _("%s: can't get size for log subvolume\n"),
342 fprintf(stderr
, _("%s: can't get size for realtime subvolume\n"),
348 if (!libxfs_bhash_size
)
349 libxfs_bhash_size
= LIBXFS_BHASHSIZE(sbp
);
350 libxfs_bcache
= cache_init(a
->bcache_flags
, libxfs_bhash_size
,
351 &libxfs_bcache_operations
);
352 use_xfs_buf_lock
= a
->usebuflock
;
364 if (!rval
&& a
->ddev
)
365 libxfs_device_close(a
->ddev
);
366 if (!rval
&& a
->logdev
)
367 libxfs_device_close(a
->logdev
);
368 if (!rval
&& a
->rtdev
)
369 libxfs_device_close(a
->rtdev
);
375 * Initialize/destroy all of the zone allocators we use.
378 manage_zones(int release
)
380 extern kmem_zone_t
*xfs_buf_zone
;
381 extern kmem_zone_t
*xfs_ili_zone
;
382 extern kmem_zone_t
*xfs_ifork_zone
;
383 extern kmem_zone_t
*xfs_buf_item_zone
;
384 extern kmem_zone_t
*xfs_da_state_zone
;
385 extern kmem_zone_t
*xfs_btree_cur_zone
;
386 extern kmem_zone_t
*xfs_bmap_free_item_zone
;
387 extern kmem_zone_t
*xfs_log_item_desc_zone
;
388 extern void xfs_dir_startup();
390 if (release
) { /* free zone allocation */
391 kmem_free(xfs_buf_zone
);
392 kmem_free(xfs_inode_zone
);
393 kmem_free(xfs_ifork_zone
);
394 kmem_free(xfs_buf_item_zone
);
395 kmem_free(xfs_da_state_zone
);
396 kmem_free(xfs_btree_cur_zone
);
397 kmem_free(xfs_bmap_free_item_zone
);
398 kmem_free(xfs_log_item_desc_zone
);
401 /* otherwise initialise zone allocation */
402 xfs_buf_zone
= kmem_zone_init(sizeof(xfs_buf_t
), "xfs_buffer");
403 xfs_inode_zone
= kmem_zone_init(sizeof(struct xfs_inode
), "xfs_inode");
404 xfs_ifork_zone
= kmem_zone_init(sizeof(xfs_ifork_t
), "xfs_ifork");
405 xfs_ili_zone
= kmem_zone_init(
406 sizeof(xfs_inode_log_item_t
), "xfs_inode_log_item");
407 xfs_buf_item_zone
= kmem_zone_init(
408 sizeof(xfs_buf_log_item_t
), "xfs_buf_log_item");
409 xfs_da_state_zone
= kmem_zone_init(
410 sizeof(xfs_da_state_t
), "xfs_da_state");
411 xfs_btree_cur_zone
= kmem_zone_init(
412 sizeof(xfs_btree_cur_t
), "xfs_btree_cur");
413 xfs_bmap_free_item_zone
= kmem_zone_init(
414 sizeof(xfs_bmap_free_item_t
), "xfs_bmap_free_item");
415 xfs_log_item_desc_zone
= kmem_zone_init(
416 sizeof(struct xfs_log_item_desc
), "xfs_log_item_desc");
421 * Initialize realtime fields in the mount structure.
425 xfs_mount_t
*mp
, /* file system mount structure */
428 xfs_buf_t
*bp
; /* buffer for last block of subvolume */
429 xfs_daddr_t d
; /* address of last block of subvolume */
430 xfs_sb_t
*sbp
; /* filesystem superblock copy in mount */
433 if (sbp
->sb_rblocks
== 0)
435 if (mp
->m_rtdev_targp
->dev
== 0 && !(flags
& LIBXFS_MOUNT_DEBUGGER
)) {
436 fprintf(stderr
, _("%s: filesystem has a realtime subvolume\n"),
440 mp
->m_rsumlevels
= sbp
->sb_rextslog
+ 1;
442 (uint
)sizeof(xfs_suminfo_t
) * mp
->m_rsumlevels
*
444 mp
->m_rsumsize
= roundup(mp
->m_rsumsize
, sbp
->sb_blocksize
);
445 mp
->m_rbmip
= mp
->m_rsumip
= NULL
;
448 * Allow debugger to be run without the realtime device present.
450 if (flags
& LIBXFS_MOUNT_DEBUGGER
)
454 * Check that the realtime section is an ok size.
456 d
= (xfs_daddr_t
)XFS_FSB_TO_BB(mp
, mp
->m_sb
.sb_rblocks
);
457 if (XFS_BB_TO_FSB(mp
, d
) != mp
->m_sb
.sb_rblocks
) {
458 fprintf(stderr
, _("%s: realtime init - %llu != %llu\n"),
459 progname
, (unsigned long long) XFS_BB_TO_FSB(mp
, d
),
460 (unsigned long long) mp
->m_sb
.sb_rblocks
);
463 bp
= libxfs_readbuf(mp
->m_rtdev
,
464 d
- XFS_FSB_TO_BB(mp
, 1), XFS_FSB_TO_BB(mp
, 1), 0, NULL
);
466 fprintf(stderr
, _("%s: realtime size check failed\n"),
475 libxfs_initialize_perag(
477 xfs_agnumber_t agcount
,
478 xfs_agnumber_t
*maxagi
)
480 xfs_agnumber_t index
, max_metadata
;
481 xfs_agnumber_t first_initialised
= 0;
485 xfs_sb_t
*sbp
= &mp
->m_sb
;
489 * Walk the current per-ag tree so we don't try to initialise AGs
490 * that already exist (growfs case). Allocate and insert all the
491 * AGs we don't find ready for initialisation.
493 for (index
= 0; index
< agcount
; index
++) {
494 pag
= xfs_perag_get(mp
, index
);
499 if (!first_initialised
)
500 first_initialised
= index
;
502 pag
= kmem_zalloc(sizeof(*pag
), KM_MAYFAIL
);
505 pag
->pag_agno
= index
;
508 if (radix_tree_insert(&mp
->m_perag_tree
, index
, pag
)) {
515 * If we mount with the inode64 option, or no inode overflows
516 * the legacy 32-bit address space clear the inode32 option.
518 agino
= XFS_OFFBNO_TO_AGINO(mp
, sbp
->sb_agblocks
- 1, 0);
519 ino
= XFS_AGINO_TO_INO(mp
, agcount
- 1, agino
);
521 if ((mp
->m_flags
& XFS_MOUNT_SMALL_INUMS
) && ino
> XFS_MAXINUMBER_32
)
522 mp
->m_flags
|= XFS_MOUNT_32BITINODES
;
524 mp
->m_flags
&= ~XFS_MOUNT_32BITINODES
;
526 if (mp
->m_flags
& XFS_MOUNT_32BITINODES
) {
528 * Calculate how much should be reserved for inodes to meet
529 * the max inode percentage.
531 if (mp
->m_maxicount
) {
534 icount
= sbp
->sb_dblocks
* sbp
->sb_imax_pct
;
536 icount
+= sbp
->sb_agblocks
- 1;
537 do_div(icount
, sbp
->sb_agblocks
);
538 max_metadata
= icount
;
540 max_metadata
= agcount
;
543 for (index
= 0; index
< agcount
; index
++) {
544 ino
= XFS_AGINO_TO_INO(mp
, index
, agino
);
545 if (ino
> XFS_MAXINUMBER_32
) {
550 pag
= xfs_perag_get(mp
, index
);
551 pag
->pagi_inodeok
= 1;
552 if (index
< max_metadata
)
553 pag
->pagf_metadata
= 1;
557 for (index
= 0; index
< agcount
; index
++) {
558 pag
= xfs_perag_get(mp
, index
);
559 pag
->pagi_inodeok
= 1;
570 for (; index
> first_initialised
; index
--) {
571 pag
= radix_tree_delete(&mp
->m_perag_tree
, index
);
577 static struct xfs_buftarg
*
578 libxfs_buftarg_alloc(
579 struct xfs_mount
*mp
,
582 struct xfs_buftarg
*btp
;
584 btp
= malloc(sizeof(*btp
));
586 fprintf(stderr
, _("%s: buftarg init failed\n"),
597 struct xfs_mount
*mp
,
602 if (mp
->m_ddev_targp
) {
603 /* should already have all buftargs initialised */
604 if (mp
->m_ddev_targp
->dev
!= dev
||
605 mp
->m_ddev_targp
->bt_mount
!= mp
) {
607 _("%s: bad buftarg reinit, ddev\n"),
611 if (!logdev
|| logdev
== dev
) {
612 if (mp
->m_logdev_targp
!= mp
->m_ddev_targp
) {
614 _("%s: bad buftarg reinit, ldev mismatch\n"),
618 } else if (mp
->m_logdev_targp
->dev
!= logdev
||
619 mp
->m_logdev_targp
->bt_mount
!= mp
) {
621 _("%s: bad buftarg reinit, logdev\n"),
625 if (rtdev
&& (mp
->m_rtdev_targp
->dev
!= rtdev
||
626 mp
->m_rtdev_targp
->bt_mount
!= mp
)) {
628 _("%s: bad buftarg reinit, rtdev\n"),
635 mp
->m_ddev_targp
= libxfs_buftarg_alloc(mp
, dev
);
636 if (!logdev
|| logdev
== dev
)
637 mp
->m_logdev_targp
= mp
->m_ddev_targp
;
639 mp
->m_logdev_targp
= libxfs_buftarg_alloc(mp
, logdev
);
640 mp
->m_rtdev_targp
= libxfs_buftarg_alloc(mp
, rtdev
);
644 * Mount structure initialization, provides a filled-in xfs_mount_t
645 * such that the numerous XFS_* macros can be used. If dev is zero,
646 * no IO will be performed (no size checks, read root inodes).
662 libxfs_buftarg_init(mp
, dev
, logdev
, rtdev
);
664 mp
->m_flags
= (LIBXFS_MOUNT_32BITINODES
|LIBXFS_MOUNT_32BITINOOPT
);
666 INIT_RADIX_TREE(&mp
->m_perag_tree
, GFP_KERNEL
);
669 xfs_sb_mount_common(mp
, sb
);
671 xfs_alloc_compute_maxlevels(mp
);
672 xfs_bmap_compute_maxlevels(mp
, XFS_DATA_FORK
);
673 xfs_bmap_compute_maxlevels(mp
, XFS_ATTR_FORK
);
674 xfs_ialloc_compute_maxlevels(mp
);
676 if (sbp
->sb_imax_pct
) {
677 /* Make sure the maximum inode count is a multiple of the
678 * units we allocate inodes in.
680 mp
->m_maxicount
= (sbp
->sb_dblocks
* sbp
->sb_imax_pct
) / 100;
681 mp
->m_maxicount
= ((mp
->m_maxicount
/ mp
->m_ialloc_blks
) *
682 mp
->m_ialloc_blks
) << sbp
->sb_inopblog
;
686 mp
->m_inode_cluster_size
= XFS_INODE_BIG_CLUSTER_SIZE
;
689 * Set whether we're using stripe alignment.
691 if (xfs_sb_version_hasdalign(&mp
->m_sb
)) {
692 mp
->m_dalign
= sbp
->sb_unit
;
693 mp
->m_swidth
= sbp
->sb_width
;
697 * Set whether we're using inode alignment.
699 if (xfs_sb_version_hasalign(&mp
->m_sb
) &&
700 mp
->m_sb
.sb_inoalignmt
>=
701 XFS_B_TO_FSBT(mp
, mp
->m_inode_cluster_size
))
702 mp
->m_inoalign_mask
= mp
->m_sb
.sb_inoalignmt
- 1;
704 mp
->m_inoalign_mask
= 0;
706 * If we are using stripe alignment, check whether
707 * the stripe unit is a multiple of the inode alignment
709 if (mp
->m_dalign
&& mp
->m_inoalign_mask
&&
710 !(mp
->m_dalign
& mp
->m_inoalign_mask
))
711 mp
->m_sinoalign
= mp
->m_dalign
;
716 * Check that the data (and log if separate) are an ok size.
718 d
= (xfs_daddr_t
) XFS_FSB_TO_BB(mp
, mp
->m_sb
.sb_dblocks
);
719 if (XFS_BB_TO_FSB(mp
, d
) != mp
->m_sb
.sb_dblocks
) {
720 fprintf(stderr
, _("%s: size check failed\n"), progname
);
721 if (!(flags
& LIBXFS_MOUNT_DEBUGGER
))
726 * We automatically convert v1 inodes to v2 inodes now, so if
727 * the NLINK bit is not set we can't operate on the filesystem.
729 if (!(sbp
->sb_versionnum
& XFS_SB_VERSION_NLINKBIT
)) {
732 "%s: V1 inodes unsupported. Please try an older xfsprogs.\n"),
737 /* Check for supported directory formats */
738 if (!(sbp
->sb_versionnum
& XFS_SB_VERSION_DIRV2BIT
)) {
741 "%s: V1 directories unsupported. Please try an older xfsprogs.\n"),
746 /* check for unsupported other features */
747 if (!xfs_sb_good_version(sbp
)) {
749 "%s: Unsupported features detected. Please try a newer xfsprogs.\n"),
756 if (xfs_sb_version_hasattr2(&mp
->m_sb
))
757 mp
->m_flags
|= LIBXFS_MOUNT_ATTR2
;
759 /* Initialize the precomputed transaction reservations values */
762 if (dev
== 0) /* maxtrres, we have no device so leave now */
765 bp
= libxfs_readbuf(mp
->m_dev
,
766 d
- XFS_FSS_TO_BB(mp
, 1), XFS_FSS_TO_BB(mp
, 1),
767 !(flags
& LIBXFS_MOUNT_DEBUGGER
), NULL
);
769 fprintf(stderr
, _("%s: data size check failed\n"), progname
);
770 if (!(flags
& LIBXFS_MOUNT_DEBUGGER
))
775 if (mp
->m_logdev_targp
->dev
&&
776 mp
->m_logdev_targp
->dev
!= mp
->m_ddev_targp
->dev
) {
777 d
= (xfs_daddr_t
) XFS_FSB_TO_BB(mp
, mp
->m_sb
.sb_logblocks
);
778 if ( (XFS_BB_TO_FSB(mp
, d
) != mp
->m_sb
.sb_logblocks
) ||
779 (!(bp
= libxfs_readbuf(mp
->m_logdev_targp
,
780 d
- XFS_FSB_TO_BB(mp
, 1),
781 XFS_FSB_TO_BB(mp
, 1),
782 !(flags
& LIBXFS_MOUNT_DEBUGGER
), NULL
))) ) {
783 fprintf(stderr
, _("%s: log size checks failed\n"),
785 if (!(flags
& LIBXFS_MOUNT_DEBUGGER
))
792 /* Initialize realtime fields in the mount structure */
793 if (rtmount_init(mp
, flags
)) {
794 fprintf(stderr
, _("%s: realtime device init failed\n"),
799 error
= libxfs_initialize_perag(mp
, sbp
->sb_agcount
, &mp
->m_maxagi
);
801 fprintf(stderr
, _("%s: perag init failed\n"),
810 libxfs_rtmount_destroy(xfs_mount_t
*mp
)
816 mp
->m_rsumip
= mp
->m_rbmip
= NULL
;
820 * Release any resource obtained during a mount.
823 libxfs_umount(xfs_mount_t
*mp
)
825 struct xfs_perag
*pag
;
828 libxfs_rtmount_destroy(mp
);
829 libxfs_bcache_purge();
831 for (agno
= 0; agno
< mp
->m_maxagi
; agno
++) {
832 pag
= radix_tree_delete(&mp
->m_perag_tree
, agno
);
838 * Release any global resources used by libxfs.
844 cache_destroy(libxfs_bcache
);
848 libxfs_device_alignment(void)
850 return platform_align_blockdev();
854 libxfs_report(FILE *fp
)
859 cache_report(fp
, "libxfs_bcache", libxfs_bcache
);
862 c
= asctime(localtime(&t
));
863 fprintf(fp
, "%s", c
);
869 return platform_nproc();
875 return platform_physmem();