xfs_fsops.c (855e7e7174bade3f2b63077a81eea5aab525dbf6) xfs_fsops.c (501ab32387533924b211cacff36d19296414ec0b)
1/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
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.
8 *

--- 588 unchanged lines hidden (view full) ---

597{
598 int error;
599
600 if (!capable(CAP_SYS_ADMIN))
601 return -EPERM;
602 if (!mutex_trylock(&mp->m_growlock))
603 return -EWOULDBLOCK;
604 error = xfs_growfs_data_private(mp, in);
1/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
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.
8 *

--- 588 unchanged lines hidden (view full) ---

597{
598 int error;
599
600 if (!capable(CAP_SYS_ADMIN))
601 return -EPERM;
602 if (!mutex_trylock(&mp->m_growlock))
603 return -EWOULDBLOCK;
604 error = xfs_growfs_data_private(mp, in);
605 /*
606 * Increment the generation unconditionally, the error could be from
607 * updating the secondary superblocks, in which case the new size
608 * is live already.
609 */
610 mp->m_generation++;
605 mutex_unlock(&mp->m_growlock);
606 return error;
607}
608
609int
610xfs_growfs_log(
611 xfs_mount_t *mp,
612 xfs_growfs_log_t *in)

--- 14 unchanged lines hidden (view full) ---

627 */
628
629int
630xfs_fs_counts(
631 xfs_mount_t *mp,
632 xfs_fsop_counts_t *cnt)
633{
634 xfs_icsb_sync_counters(mp, XFS_ICSB_LAZY_COUNT);
611 mutex_unlock(&mp->m_growlock);
612 return error;
613}
614
615int
616xfs_growfs_log(
617 xfs_mount_t *mp,
618 xfs_growfs_log_t *in)

--- 14 unchanged lines hidden (view full) ---

633 */
634
635int
636xfs_fs_counts(
637 xfs_mount_t *mp,
638 xfs_fsop_counts_t *cnt)
639{
640 xfs_icsb_sync_counters(mp, XFS_ICSB_LAZY_COUNT);
641 cnt->allocino = percpu_counter_read_positive(&mp->m_icount);
642
635 spin_lock(&mp->m_sb_lock);
636 cnt->freedata = mp->m_sb.sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp);
637 cnt->freertx = mp->m_sb.sb_frextents;
638 cnt->freeino = mp->m_sb.sb_ifree;
643 spin_lock(&mp->m_sb_lock);
644 cnt->freedata = mp->m_sb.sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp);
645 cnt->freertx = mp->m_sb.sb_frextents;
646 cnt->freeino = mp->m_sb.sb_ifree;
639 cnt->allocino = mp->m_sb.sb_icount;
640 spin_unlock(&mp->m_sb_lock);
641 return 0;
642}
643
644/*
645 * exported through ioctl XFS_IOC_SET_RESBLKS & XFS_IOC_GET_RESBLKS
646 *
647 * xfs_reserve_blocks is called to set m_resblks

--- 201 unchanged lines hidden ---
647 spin_unlock(&mp->m_sb_lock);
648 return 0;
649}
650
651/*
652 * exported through ioctl XFS_IOC_SET_RESBLKS & XFS_IOC_GET_RESBLKS
653 *
654 * xfs_reserve_blocks is called to set m_resblks

--- 201 unchanged lines hidden ---