1 diff -ruNX /home/jack/.kerndiffexclude linux-2.6.0-test7/fs/dquot.c linux-2.6.0-test7-1-lockfix/fs/dquot.c
2 --- linux-2.6.0-test7/fs/dquot.c Tue Oct 14 15:52:08 2003
3 +++ linux-2.6.0-test7-1-lockfix/fs/dquot.c Tue Oct 14 16:26:28 2003
8 - * Release all quota for the specified inode.
10 - * Note: this is a blocking operation.
11 + * Remove references to quota from inode
12 + * This function needs dqptr_sem for writing
14 -static void dquot_drop_nolock(struct inode *inode)
15 +static void dquot_drop_iupdate(struct inode *inode, struct dquot **to_drop)
19 inode->i_flags &= ~S_QUOTA;
20 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
21 - if (inode->i_dquot[cnt] == NODQUOT)
23 - dqput(inode->i_dquot[cnt]);
24 + to_drop[cnt] = inode->i_dquot[cnt];
25 inode->i_dquot[cnt] = NODQUOT;
30 + * Release all quotas referenced by inode
32 void dquot_drop(struct inode *inode)
34 + struct dquot *to_drop[MAXQUOTAS];
37 down_write(&sb_dqopt(inode->i_sb)->dqptr_sem);
38 - dquot_drop_nolock(inode);
39 + dquot_drop_iupdate(inode, to_drop);
40 up_write(&sb_dqopt(inode->i_sb)->dqptr_sem);
41 + for (cnt = 0; cnt < MAXQUOTAS; cnt++)
42 + if (to_drop[cnt] != NODQUOT)
43 + dqput(to_drop[cnt]);
47 + * Release all quotas referenced by inode.
48 + * This function assumes dqptr_sem for writing
50 +void dquot_drop_nolock(struct inode *inode)
52 + struct dquot *to_drop[MAXQUOTAS];
55 + dquot_drop_iupdate(inode, to_drop);
56 + for (cnt = 0; cnt < MAXQUOTAS; cnt++)
57 + if (to_drop[cnt] != NODQUOT)
58 + dqput(to_drop[cnt]);
63 warntype[cnt] = NOWARN;
65 down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
66 + if (IS_NOQUOTA(inode)) {
67 + up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
70 spin_lock(&dq_data_lock);
71 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
72 if (inode->i_dquot[cnt] == NODQUOT)
74 for (cnt = 0; cnt < MAXQUOTAS; cnt++)
75 warntype[cnt] = NOWARN;
76 down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
77 + if (IS_NOQUOTA(inode)) {
78 + up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
81 spin_lock(&dq_data_lock);
82 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
83 if (inode->i_dquot[cnt] == NODQUOT)
87 down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
88 + if (IS_NOQUOTA(inode)) {
89 + up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
92 spin_lock(&dq_data_lock);
93 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
94 if (inode->i_dquot[cnt] == NODQUOT)
98 down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
99 + if (IS_NOQUOTA(inode)) {
100 + up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
103 spin_lock(&dq_data_lock);
104 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
105 if (inode->i_dquot[cnt] == NODQUOT)