aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2005-11-01 18:32:38 -0500
committerNathan Scott <nathans@sgi.com>2005-11-01 18:32:38 -0500
commitee34807a65aa0c5911dc27682863afca780a003e (patch)
tree6111a529078e9e12ce5102f7c736f649fb3ec498
parentc310ab6c071a688e5291028972d1ae8314f67536 (diff)
[XFS] Provide a mechiansm for flushing delalloc before quota reporting.
SGI-PV: 942815 SGI-Modid: xfs-linux:xfs-kern:23829a Signed-off-by: Nathan Scott <nathans@sgi.com>
-rw-r--r--fs/xfs/linux-2.6/xfs_fs_subr.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c13
-rw-r--r--fs/xfs/quota/xfs_qm_syscalls.c7
-rw-r--r--fs/xfs/xfs_mount.h1
-rw-r--r--fs/xfs/xfs_vfsops.c4
5 files changed, 23 insertions, 4 deletions
diff --git a/fs/xfs/linux-2.6/xfs_fs_subr.c b/fs/xfs/linux-2.6/xfs_fs_subr.c
index 05ebd30ec96f..88134cba5cb0 100644
--- a/fs/xfs/linux-2.6/xfs_fs_subr.c
+++ b/fs/xfs/linux-2.6/xfs_fs_subr.c
@@ -117,6 +117,8 @@ fs_flush_pages(
117 117
118 if (VN_CACHED(vp)) { 118 if (VN_CACHED(vp)) {
119 filemap_fdatawrite(ip->i_mapping); 119 filemap_fdatawrite(ip->i_mapping);
120 if (flags & XFS_B_ASYNC)
121 return 0;
120 filemap_fdatawait(ip->i_mapping); 122 filemap_fdatawait(ip->i_mapping);
121 } 123 }
122 124
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index d2701cc624b9..fa87279405d8 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -767,6 +767,18 @@ linvfs_show_options(
767} 767}
768 768
769STATIC int 769STATIC int
770linvfs_quotasync(
771 struct super_block *sb,
772 int type)
773{
774 struct vfs *vfsp = LINVFS_GET_VFS(sb);
775 int error;
776
777 VFS_QUOTACTL(vfsp, Q_XQUOTASYNC, 0, (caddr_t)NULL, error);
778 return -error;
779}
780
781STATIC int
770linvfs_getxstate( 782linvfs_getxstate(
771 struct super_block *sb, 783 struct super_block *sb,
772 struct fs_quota_stat *fqs) 784 struct fs_quota_stat *fqs)
@@ -934,6 +946,7 @@ STATIC struct super_operations linvfs_sops = {
934}; 946};
935 947
936STATIC struct quotactl_ops linvfs_qops = { 948STATIC struct quotactl_ops linvfs_qops = {
949 .quota_sync = linvfs_quotasync,
937 .get_xstate = linvfs_getxstate, 950 .get_xstate = linvfs_getxstate,
938 .set_xstate = linvfs_setxstate, 951 .set_xstate = linvfs_setxstate,
939 .get_xquota = linvfs_getxquota, 952 .get_xquota = linvfs_getxquota,
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c
index 4e397940b3a6..485f83d41191 100644
--- a/fs/xfs/quota/xfs_qm_syscalls.c
+++ b/fs/xfs/quota/xfs_qm_syscalls.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. 2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 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 5 * under the terms of version 2 of the GNU General Public License as
@@ -109,7 +109,7 @@ xfs_qm_quotactl(
109 vfsp = bhvtovfs(bdp); 109 vfsp = bhvtovfs(bdp);
110 mp = XFS_VFSTOM(vfsp); 110 mp = XFS_VFSTOM(vfsp);
111 111
112 ASSERT(addr != NULL); 112 ASSERT(addr != NULL || cmd == Q_XQUOTASYNC);
113 113
114 /* 114 /*
115 * The following commands are valid even when quotaoff. 115 * The following commands are valid even when quotaoff.
@@ -147,6 +147,9 @@ xfs_qm_quotactl(
147 return XFS_ERROR(EROFS); 147 return XFS_ERROR(EROFS);
148 break; 148 break;
149 149
150 case Q_XQUOTASYNC:
151 return (xfs_sync_inodes(mp, SYNC_DELWRI, 0, NULL));
152
150 default: 153 default:
151 break; 154 break;
152 } 155 }
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index bc55931ac74e..0653beecf93a 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -556,6 +556,7 @@ extern int xfs_readsb(xfs_mount_t *mp);
556extern void xfs_freesb(xfs_mount_t *); 556extern void xfs_freesb(xfs_mount_t *);
557extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int); 557extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int);
558extern int xfs_syncsub(xfs_mount_t *, int, int, int *); 558extern int xfs_syncsub(xfs_mount_t *, int, int, int *);
559extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *);
559extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t); 560extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t);
560extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t); 561extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t);
561 562
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index 8238c7517822..9142351df515 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -903,7 +903,7 @@ xfs_sync(
903 * only available by calling this routine. 903 * only available by calling this routine.
904 * 904 *
905 */ 905 */
906STATIC int 906int
907xfs_sync_inodes( 907xfs_sync_inodes(
908 xfs_mount_t *mp, 908 xfs_mount_t *mp,
909 int flags, 909 int flags,
@@ -987,7 +987,7 @@ xfs_sync_inodes(
987 ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP); 987 ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP);
988 988
989 fflag = XFS_B_ASYNC; /* default is don't wait */ 989 fflag = XFS_B_ASYNC; /* default is don't wait */
990 if (flags & SYNC_BDFLUSH) 990 if (flags & (SYNC_BDFLUSH | SYNC_DELWRI))
991 fflag = XFS_B_DELWRI; 991 fflag = XFS_B_DELWRI;
992 if (flags & SYNC_WAIT) 992 if (flags & SYNC_WAIT)
993 fflag = 0; /* synchronous overrides all */ 993 fflag = 0; /* synchronous overrides all */