aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-05-13 13:58:50 -0400
committerJan Kara <jack@suse.cz>2010-05-21 13:30:45 -0400
commitbc8e5f07392f05c47c8bdeff4f7098db440d065c (patch)
tree5ab56dabd75912267764849a594ec2f271fd4352 /include
parent12755627bdcddcdb30a1bfb9a09395a52b1d6838 (diff)
quota: Refactor dquot_transfer code so that OCFS2 can pass in its references
Currently, __dquot_transfer() acquires its own references of dquot structures that will be put into inode. But for OCFS2, this creates a lock inversion between dq_lock (waited on in dqget) and transaction start (started in ocfs2_setattr). Currently, deadlock is impossible because dq_lock is acquired only during dquot_acquire and dquot_release and we already hold a reference to dquot structures in ocfs2_setattr so neither of these functions can be called while we call dquot_transfer. But this is rather subtle and it is hard to teach lockdep about it. So provide __dquot_transfer function that can be passed dquot references directly. OCFS2 can then pass acquired dquot references directly to __dquot_transfer with proper locking. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include')
-rw-r--r--include/linux/quotaops.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 8a7818764a67..370abb1e99cb 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -76,6 +76,7 @@ int vfs_get_dqblk(struct super_block *sb, int type, qid_t id,
76int vfs_set_dqblk(struct super_block *sb, int type, qid_t id, 76int vfs_set_dqblk(struct super_block *sb, int type, qid_t id,
77 struct fs_disk_quota *di); 77 struct fs_disk_quota *di);
78 78
79int __dquot_transfer(struct inode *inode, struct dquot **transfer_to);
79int dquot_transfer(struct inode *inode, struct iattr *iattr); 80int dquot_transfer(struct inode *inode, struct iattr *iattr);
80int vfs_dq_quota_on_remount(struct super_block *sb); 81int vfs_dq_quota_on_remount(struct super_block *sb);
81 82