aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/gfs2/quota.c4
-rw-r--r--fs/gfs2/quota.h2
-rw-r--r--fs/gfs2/super.c2
-rw-r--r--fs/gfs2/sys.c2
-rw-r--r--fs/quota/dquot.c24
-rw-r--r--fs/quota/quota.c4
-rw-r--r--fs/sync.c2
-rw-r--r--include/linux/quota.h2
-rw-r--r--include/linux/quotaops.h8
9 files changed, 37 insertions, 13 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index b97178e7d397..27b5cc7d6881 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -1108,7 +1108,7 @@ void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
1108 } 1108 }
1109} 1109}
1110 1110
1111int gfs2_quota_sync(struct super_block *sb, int type, int wait) 1111int gfs2_quota_sync(struct super_block *sb, int type)
1112{ 1112{
1113 struct gfs2_sbd *sdp = sb->s_fs_info; 1113 struct gfs2_sbd *sdp = sb->s_fs_info;
1114 struct gfs2_quota_data **qda; 1114 struct gfs2_quota_data **qda;
@@ -1154,7 +1154,7 @@ int gfs2_quota_sync(struct super_block *sb, int type, int wait)
1154 1154
1155static int gfs2_quota_sync_timeo(struct super_block *sb, int type) 1155static int gfs2_quota_sync_timeo(struct super_block *sb, int type)
1156{ 1156{
1157 return gfs2_quota_sync(sb, type, 0); 1157 return gfs2_quota_sync(sb, type);
1158} 1158}
1159 1159
1160int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id) 1160int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id)
diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h
index 90bf1c302a98..f25d98b87904 100644
--- a/fs/gfs2/quota.h
+++ b/fs/gfs2/quota.h
@@ -26,7 +26,7 @@ extern int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid);
26extern void gfs2_quota_change(struct gfs2_inode *ip, s64 change, 26extern void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
27 u32 uid, u32 gid); 27 u32 uid, u32 gid);
28 28
29extern int gfs2_quota_sync(struct super_block *sb, int type, int wait); 29extern int gfs2_quota_sync(struct super_block *sb, int type);
30extern int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id); 30extern int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id);
31 31
32extern int gfs2_quota_init(struct gfs2_sbd *sdp); 32extern int gfs2_quota_init(struct gfs2_sbd *sdp);
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 713e621c240b..313c329490e2 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -838,7 +838,7 @@ static int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
838 int error; 838 int error;
839 839
840 flush_workqueue(gfs2_delete_workqueue); 840 flush_workqueue(gfs2_delete_workqueue);
841 gfs2_quota_sync(sdp->sd_vfs, 0, 1); 841 gfs2_quota_sync(sdp->sd_vfs, 0);
842 gfs2_statfs_sync(sdp->sd_vfs, 0); 842 gfs2_statfs_sync(sdp->sd_vfs, 0);
843 843
844 error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED, GL_NOCACHE, 844 error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED, GL_NOCACHE,
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 9c2592b1d5ff..73ecc34c4342 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -168,7 +168,7 @@ static ssize_t quota_sync_store(struct gfs2_sbd *sdp, const char *buf,
168 if (simple_strtol(buf, NULL, 0) != 1) 168 if (simple_strtol(buf, NULL, 0) != 1)
169 return -EINVAL; 169 return -EINVAL;
170 170
171 gfs2_quota_sync(sdp->sd_vfs, 0, 1); 171 gfs2_quota_sync(sdp->sd_vfs, 0);
172 return len; 172 return len;
173} 173}
174 174
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 10cbe841cb7e..d679fc48ef27 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -595,12 +595,14 @@ out:
595} 595}
596EXPORT_SYMBOL(dquot_scan_active); 596EXPORT_SYMBOL(dquot_scan_active);
597 597
598int dquot_quota_sync(struct super_block *sb, int type, int wait) 598/* Write all dquot structures to quota files */
599int dquot_writeback_dquots(struct super_block *sb, int type)
599{ 600{
600 struct list_head *dirty; 601 struct list_head *dirty;
601 struct dquot *dquot; 602 struct dquot *dquot;
602 struct quota_info *dqopt = sb_dqopt(sb); 603 struct quota_info *dqopt = sb_dqopt(sb);
603 int cnt; 604 int cnt;
605 int err, ret = 0;
604 606
605 mutex_lock(&dqopt->dqonoff_mutex); 607 mutex_lock(&dqopt->dqonoff_mutex);
606 for (cnt = 0; cnt < MAXQUOTAS; cnt++) { 608 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
@@ -624,7 +626,9 @@ int dquot_quota_sync(struct super_block *sb, int type, int wait)
624 atomic_inc(&dquot->dq_count); 626 atomic_inc(&dquot->dq_count);
625 spin_unlock(&dq_list_lock); 627 spin_unlock(&dq_list_lock);
626 dqstats_inc(DQST_LOOKUPS); 628 dqstats_inc(DQST_LOOKUPS);
627 sb->dq_op->write_dquot(dquot); 629 err = sb->dq_op->write_dquot(dquot);
630 if (!ret && err)
631 err = ret;
628 dqput(dquot); 632 dqput(dquot);
629 spin_lock(&dq_list_lock); 633 spin_lock(&dq_list_lock);
630 } 634 }
@@ -638,7 +642,21 @@ int dquot_quota_sync(struct super_block *sb, int type, int wait)
638 dqstats_inc(DQST_SYNCS); 642 dqstats_inc(DQST_SYNCS);
639 mutex_unlock(&dqopt->dqonoff_mutex); 643 mutex_unlock(&dqopt->dqonoff_mutex);
640 644
641 if (!wait || (dqopt->flags & DQUOT_QUOTA_SYS_FILE)) 645 return ret;
646}
647EXPORT_SYMBOL(dquot_writeback_dquots);
648
649/* Write all dquot structures to disk and make them visible from userspace */
650int dquot_quota_sync(struct super_block *sb, int type)
651{
652 struct quota_info *dqopt = sb_dqopt(sb);
653 int cnt;
654 int ret;
655
656 ret = dquot_writeback_dquots(sb, type);
657 if (ret)
658 return ret;
659 if (dqopt->flags & DQUOT_QUOTA_SYS_FILE)
642 return 0; 660 return 0;
643 661
644 /* This is not very clever (and fast) but currently I don't know about 662 /* This is not very clever (and fast) but currently I don't know about
diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 9a391204ca27..c659f92298d3 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -47,7 +47,7 @@ static int check_quotactl_permission(struct super_block *sb, int type, int cmd,
47static void quota_sync_one(struct super_block *sb, void *arg) 47static void quota_sync_one(struct super_block *sb, void *arg)
48{ 48{
49 if (sb->s_qcop && sb->s_qcop->quota_sync) 49 if (sb->s_qcop && sb->s_qcop->quota_sync)
50 sb->s_qcop->quota_sync(sb, *(int *)arg, 1); 50 sb->s_qcop->quota_sync(sb, *(int *)arg);
51} 51}
52 52
53static int quota_sync_all(int type) 53static int quota_sync_all(int type)
@@ -270,7 +270,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
270 case Q_SYNC: 270 case Q_SYNC:
271 if (!sb->s_qcop->quota_sync) 271 if (!sb->s_qcop->quota_sync)
272 return -ENOSYS; 272 return -ENOSYS;
273 return sb->s_qcop->quota_sync(sb, type, 1); 273 return sb->s_qcop->quota_sync(sb, type);
274 case Q_XQUOTAON: 274 case Q_XQUOTAON:
275 case Q_XQUOTAOFF: 275 case Q_XQUOTAOFF:
276 case Q_XQUOTARM: 276 case Q_XQUOTARM:
diff --git a/fs/sync.c b/fs/sync.c
index b3d2a001293f..cae145dd8018 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -30,7 +30,7 @@
30static int __sync_filesystem(struct super_block *sb, int wait) 30static int __sync_filesystem(struct super_block *sb, int wait)
31{ 31{
32 if (sb->s_qcop && sb->s_qcop->quota_sync) 32 if (sb->s_qcop && sb->s_qcop->quota_sync)
33 sb->s_qcop->quota_sync(sb, -1, wait); 33 sb->s_qcop->quota_sync(sb, -1);
34 34
35 if (wait) 35 if (wait)
36 sync_inodes_sb(sb); 36 sync_inodes_sb(sb);
diff --git a/include/linux/quota.h b/include/linux/quota.h
index c09fa042b5ea..524ede8a160a 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -333,7 +333,7 @@ struct quotactl_ops {
333 int (*quota_on)(struct super_block *, int, int, struct path *); 333 int (*quota_on)(struct super_block *, int, int, struct path *);
334 int (*quota_on_meta)(struct super_block *, int, int); 334 int (*quota_on_meta)(struct super_block *, int, int);
335 int (*quota_off)(struct super_block *, int); 335 int (*quota_off)(struct super_block *, int);
336 int (*quota_sync)(struct super_block *, int, int); 336 int (*quota_sync)(struct super_block *, int);
337 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 337 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
338 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 338 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
339 int (*get_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *); 339 int (*get_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *);
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 17b977304a09..ec6b65feaaba 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -83,7 +83,8 @@ int dquot_quota_on(struct super_block *sb, int type, int format_id,
83int dquot_quota_on_mount(struct super_block *sb, char *qf_name, 83int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
84 int format_id, int type); 84 int format_id, int type);
85int dquot_quota_off(struct super_block *sb, int type); 85int dquot_quota_off(struct super_block *sb, int type);
86int dquot_quota_sync(struct super_block *sb, int type, int wait); 86int dquot_writeback_dquots(struct super_block *sb, int type);
87int dquot_quota_sync(struct super_block *sb, int type);
87int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 88int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
88int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 89int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
89int dquot_get_dqblk(struct super_block *sb, int type, qid_t id, 90int dquot_get_dqblk(struct super_block *sb, int type, qid_t id,
@@ -255,6 +256,11 @@ static inline int dquot_resume(struct super_block *sb, int type)
255 256
256#define dquot_file_open generic_file_open 257#define dquot_file_open generic_file_open
257 258
259static inline int dquot_writeback_dquots(struct super_block *sb, int type)
260{
261 return 0;
262}
263
258#endif /* CONFIG_QUOTA */ 264#endif /* CONFIG_QUOTA */
259 265
260static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr) 266static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr)