[BACK]Return to quota-delalloc CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / split-patches

File: [Development] / linux-2.6-xfs / split-patches / Attic / quota-delalloc (download)

Revision 1.1, Fri Sep 16 15:14:25 2005 UTC (12 years, 1 month ago) by nathans.longdrop.melbourne.sgi.com
Branch: MAIN

Add a mechanism for flushing delalloc space before quota requests are made.
Merge of 2.6.x-xfs-melb:linux:23826a by kenmcd.

Index: 2.6.x-xfs/include/linux/dqblk_xfs.h
===================================================================
--- 2.6.x-xfs.orig/include/linux/dqblk_xfs.h	2005-08-29 13:29:22.781843869 +1000
+++ 2.6.x-xfs/include/linux/dqblk_xfs.h	2005-09-16 09:46:15.024988249 +1000
@@ -41,6 +41,7 @@
 #define Q_XSETQLIM	XQM_CMD(4)	/* set disk limits */
 #define Q_XGETQSTAT	XQM_CMD(5)	/* get quota subsystem status */
 #define Q_XQUOTARM	XQM_CMD(6)	/* free disk space used by dquots */
+#define Q_XQUOTASYNC	XQM_CMD(7)	/* delalloc flush, updates dquots */
 
 /*
  * fs_disk_quota structure:
Index: 2.6.x-xfs/fs/quota.c
===================================================================
--- 2.6.x-xfs.orig/fs/quota.c	2005-08-29 13:13:45.455774915 +1000
+++ 2.6.x-xfs/fs/quota.c	2005-09-16 09:46:15.024988249 +1000
@@ -118,6 +118,10 @@
 			if (!sb->s_qcop->get_xquota)
 				return -ENOSYS;
 			break;
+		case Q_XQUOTASYNC:
+			if (!sb->s_qcop->quota_sync)
+				return -ENOSYS;
+			break;
 		default:
 			return -EINVAL;
 	}
@@ -128,7 +132,7 @@
 		     (type == XQM_GRPQUOTA && !in_egroup_p(id))) &&
 		     !capable(CAP_SYS_ADMIN))
 			return -EPERM;
-	} else if (cmd != Q_XGETQSTAT) {
+	} else if (cmd != Q_XGETQSTAT && cmd != Q_XQUOTASYNC) {
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 	}
@@ -322,6 +326,8 @@
 				return -EFAULT;
 			return 0;
 		}
+		case Q_XQUOTASYNC:
+			return sb->s_qcop->quota_sync(sb, type);
 		/* We never reach here unless validity check is broken */
 		default:
 			BUG();