STATIC int xfs_qm_syncall( struct bhv_desc *bhv, int flags, cred_t *credp) { struct vfs *vfsp = bhvtovfs(bhv); struct xfs_mount *mp = XFS_VFSTOM(vfsp); int error; /* * Get the Quota Manager to flush the dquots. */ if (XFS_IS_QUOTA_ON(mp)) { if ((error = xfs_qm_sync(mp, flags))) { /* * If we got an IO error, we will be shutting down. * So, there's nothing more for us to do here. */ ASSERT(error != EIO || XFS_FORCED_SHUTDOWN(mp)); if (XFS_FORCED_SHUTDOWN(mp)) { return XFS_ERROR(error); } } } PVFS_SYNC(BHV_NEXT(bhv), flags, credp, error); return error; }
STATIC int xfs_qm_showargs( struct bhv_desc *bhv, struct seq_file *m) { struct vfs *vfsp = bhvtovfs(bhv); struct xfs_mount *mp = XFS_VFSTOM(vfsp); int error; if (mp->m_qflags & XFS_UQUOTA_ACCT) { (mp->m_qflags & XFS_UQUOTA_ENFD) ? seq_puts(m, "," MNTOPT_USRQUOTA) : seq_puts(m, "," MNTOPT_UQUOTANOENF); } if (mp->m_qflags & XFS_PQUOTA_ACCT) { (mp->m_qflags & XFS_OQUOTA_ENFD) ? seq_puts(m, "," MNTOPT_PRJQUOTA) : seq_puts(m, "," MNTOPT_PQUOTANOENF); } if (mp->m_qflags & XFS_GQUOTA_ACCT) { (mp->m_qflags & XFS_OQUOTA_ENFD) ? seq_puts(m, "," MNTOPT_GRPQUOTA) : seq_puts(m, "," MNTOPT_GQUOTANOENF); } if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) seq_puts(m, "," MNTOPT_NOQUOTA); PVFS_SHOWARGS(BHV_NEXT(bhv), m, error); return error; }
STATIC int xfs_qm_parseargs( struct bhv_desc *bhv, char *options, struct xfs_mount_args *args, int update) { size_t length; char *local_options = options; char *this_char; int error; int referenced = update; while ((this_char = strsep(&local_options, ",")) != NULL) { length = strlen(this_char); if (local_options) length++; if (!strcmp(this_char, MNTOPT_NOQUOTA)) { args->flags &= ~(XFSMNT_UQUOTAENF|XFSMNT_UQUOTA); args->flags &= ~(XFSMNT_GQUOTAENF|XFSMNT_GQUOTA); referenced = update; } else if (!strcmp(this_char, MNTOPT_QUOTA) || !strcmp(this_char, MNTOPT_UQUOTA) || !strcmp(this_char, MNTOPT_USRQUOTA)) { args->flags |= XFSMNT_UQUOTA | XFSMNT_UQUOTAENF; referenced = 1; } else if (!strcmp(this_char, MNTOPT_QUOTANOENF) || !strcmp(this_char, MNTOPT_UQUOTANOENF)) { args->flags |= XFSMNT_UQUOTA; args->flags &= ~XFSMNT_UQUOTAENF; referenced = 1; } else if (!strcmp(this_char, MNTOPT_GQUOTA) || !strcmp(this_char, MNTOPT_GRPQUOTA)) { args->flags |= XFSMNT_GQUOTA | XFSMNT_GQUOTAENF; referenced = 1; } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { args->flags |= XFSMNT_GQUOTA; args->flags &= ~XFSMNT_GQUOTAENF; referenced = 1; } else { if (local_options) *(local_options-1) = ','; continue; } while (length--) *this_char++ = ','; } PVFS_PARSEARGS(BHV_NEXT(bhv), options, args, update, error); if (!error && !referenced) bhv_remove_vfsops(bhvtovfs(bhv), VFS_POSITION_QM); return error; }
void vfs_freeze( struct bhv_desc *bdp) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_freeze) next = BHV_NEXT(next); ((*bhvtovfsops(next)->vfs_freeze)(next)); }
int vfs_showargs( struct bhv_desc *bdp, struct seq_file *m) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_showargs) next = BHV_NEXT(next); return ((*bhvtovfsops(next)->vfs_showargs)(next, m)); }
int vfs_dmapiops( struct bhv_desc *bdp, caddr_t addr) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_dmapiops) next = BHV_NEXT(next); return ((*bhvtovfsops(next)->vfs_dmapiops)(next, addr)); }
int vfs_root( struct bhv_desc *bdp, struct vnode **vpp) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_root) next = BHV_NEXT(next); return ((*bhvtovfsops(next)->vfs_root)(next, vpp)); }
int vfs_mntupdate( struct bhv_desc *bdp, int *fl, struct xfs_mount_args *args) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_mntupdate) next = BHV_NEXT(next); return ((*bhvtovfsops(next)->vfs_mntupdate)(next, fl, args)); }
int vfs_unmount( struct bhv_desc *bdp, int fl, struct cred *cr) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_unmount) next = BHV_NEXT(next); return ((*bhvtovfsops(next)->vfs_unmount)(next, fl, cr)); }
int vfs_mount( struct bhv_desc *bdp, struct xfs_mount_args *args, struct cred *cr) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_mount) next = BHV_NEXT(next); return ((*bhvtovfsops(next)->vfs_mount)(next, args, cr)); }
int vfs_statvfs( struct bhv_desc *bdp, xfs_statfs_t *sp, struct vnode *vp) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_statvfs) next = BHV_NEXT(next); return ((*bhvtovfsops(next)->vfs_statvfs)(next, sp, vp)); }
int vfs_parseargs( struct bhv_desc *bdp, char *s, struct xfs_mount_args *args, int f) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_parseargs) next = BHV_NEXT(next); return ((*bhvtovfsops(next)->vfs_parseargs)(next, s, args, f)); }
void vfs_force_shutdown( struct bhv_desc *bdp, int fl, char *file, int line) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_force_shutdown) next = BHV_NEXT(next); ((*bhvtovfsops(next)->vfs_force_shutdown)(next, fl, file, line)); }
void vfs_init_vnode( struct bhv_desc *bdp, struct vnode *vp, struct bhv_desc *bp, int unlock) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_init_vnode) next = BHV_NEXT(next); ((*bhvtovfsops(next)->vfs_init_vnode)(next, vp, bp, unlock)); }
int vfs_quotactl( struct bhv_desc *bdp, int cmd, int id, caddr_t addr) { struct bhv_desc *next = bdp; ASSERT(next); while (! (bhvtovfsops(next))->vfs_quotactl) next = BHV_NEXT(next); return ((*bhvtovfsops(next)->vfs_quotactl)(next, cmd, id, addr)); }
STATIC int xfs_qm_mount( struct bhv_desc *bhv, struct xfs_mount_args *args, struct cred *cr) { struct vfs *vfsp = bhvtovfs(bhv); struct xfs_mount *mp = XFS_VFSTOM(vfsp); int error; if (args->flags & (XFSMNT_UQUOTA | XFSMNT_GQUOTA | XFSMNT_PQUOTA)) xfs_qm_mount_quotainit(mp, args->flags); PVFS_MOUNT(BHV_NEXT(bhv), args, cr, error); return error; }