aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-09-26 05:50:29 -0400
committerAnton Altaparmakov <aia21@cantab.net>2005-09-26 05:50:29 -0400
commite8c2cd99a3933d93413910bc93cbd5b53177110b (patch)
treeea4c1d63b1bdeb9ef1aacacad0ac9c7dc0768fdc /fs
parent5a8c0cc32bb6e029cd9c36f655c6b0955b0d9967 (diff)
parent8ddec7460d2f5db3ac35812c03676b1473d1d668 (diff)
Merge branch 'master' of /home/src/linux-2.6/
Diffstat (limited to 'fs')
-rw-r--r--fs/9p/conv.c157
-rw-r--r--fs/9p/v9fs.c8
-rw-r--r--fs/9p/vfs_inode.c4
-rw-r--r--fs/9p/vfs_super.c24
-rw-r--r--fs/cifs/cifsfs.c2
-rw-r--r--fs/cifs/connect.c2
-rw-r--r--fs/ext3/balloc.c6
-rw-r--r--fs/ext3/resize.c6
-rw-r--r--fs/ext3/super.c11
-rw-r--r--fs/jfs/inode.c3
-rw-r--r--fs/jfs/jfs_dmap.c2
-rw-r--r--fs/jfs/jfs_txnmgr.c15
-rw-r--r--fs/jfs/jfs_txnmgr.h1
-rw-r--r--fs/nfs/read.c5
-rw-r--r--fs/proc/base.c8
15 files changed, 138 insertions, 116 deletions
diff --git a/fs/9p/conv.c b/fs/9p/conv.c
index 1554731bd653..18121af99d3e 100644
--- a/fs/9p/conv.c
+++ b/fs/9p/conv.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * 9P protocol conversion functions 4 * 9P protocol conversion functions
5 * 5 *
6 * Copyright (C) 2004, 2005 by Latchesar Ionkov <lucho@ionkov.net>
6 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com> 7 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
7 * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov> 8 * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
8 * 9 *
@@ -55,66 +56,70 @@ static inline int buf_check_overflow(struct cbuf *buf)
55 return buf->p > buf->ep; 56 return buf->p > buf->ep;
56} 57}
57 58
58static inline void buf_check_size(struct cbuf *buf, int len) 59static inline int buf_check_size(struct cbuf *buf, int len)
59{ 60{
60 if (buf->p+len > buf->ep) { 61 if (buf->p+len > buf->ep) {
61 if (buf->p < buf->ep) { 62 if (buf->p < buf->ep) {
62 eprintk(KERN_ERR, "buffer overflow\n"); 63 eprintk(KERN_ERR, "buffer overflow\n");
63 buf->p = buf->ep + 1; 64 buf->p = buf->ep + 1;
65 return 0;
64 } 66 }
65 } 67 }
68
69 return 1;
66} 70}
67 71
68static inline void *buf_alloc(struct cbuf *buf, int len) 72static inline void *buf_alloc(struct cbuf *buf, int len)
69{ 73{
70 void *ret = NULL; 74 void *ret = NULL;
71 75
72 buf_check_size(buf, len); 76 if (buf_check_size(buf, len)) {
73 ret = buf->p; 77 ret = buf->p;
74 buf->p += len; 78 buf->p += len;
79 }
75 80
76 return ret; 81 return ret;
77} 82}
78 83
79static inline void buf_put_int8(struct cbuf *buf, u8 val) 84static inline void buf_put_int8(struct cbuf *buf, u8 val)
80{ 85{
81 buf_check_size(buf, 1); 86 if (buf_check_size(buf, 1)) {
82 87 buf->p[0] = val;
83 buf->p[0] = val; 88 buf->p++;
84 buf->p++; 89 }
85} 90}
86 91
87static inline void buf_put_int16(struct cbuf *buf, u16 val) 92static inline void buf_put_int16(struct cbuf *buf, u16 val)
88{ 93{
89 buf_check_size(buf, 2); 94 if (buf_check_size(buf, 2)) {
90 95 *(__le16 *) buf->p = cpu_to_le16(val);
91 *(__le16 *) buf->p = cpu_to_le16(val); 96 buf->p += 2;
92 buf->p += 2; 97 }
93} 98}
94 99
95static inline void buf_put_int32(struct cbuf *buf, u32 val) 100static inline void buf_put_int32(struct cbuf *buf, u32 val)
96{ 101{
97 buf_check_size(buf, 4); 102 if (buf_check_size(buf, 4)) {
98 103 *(__le32 *)buf->p = cpu_to_le32(val);
99 *(__le32 *)buf->p = cpu_to_le32(val); 104 buf->p += 4;
100 buf->p += 4; 105 }
101} 106}
102 107
103static inline void buf_put_int64(struct cbuf *buf, u64 val) 108static inline void buf_put_int64(struct cbuf *buf, u64 val)
104{ 109{
105 buf_check_size(buf, 8); 110 if (buf_check_size(buf, 8)) {
106 111 *(__le64 *)buf->p = cpu_to_le64(val);
107 *(__le64 *)buf->p = cpu_to_le64(val); 112 buf->p += 8;
108 buf->p += 8; 113 }
109} 114}
110 115
111static inline void buf_put_stringn(struct cbuf *buf, const char *s, u16 slen) 116static inline void buf_put_stringn(struct cbuf *buf, const char *s, u16 slen)
112{ 117{
113 buf_check_size(buf, slen + 2); 118 if (buf_check_size(buf, slen + 2)) {
114 119 buf_put_int16(buf, slen);
115 buf_put_int16(buf, slen); 120 memcpy(buf->p, s, slen);
116 memcpy(buf->p, s, slen); 121 buf->p += slen;
117 buf->p += slen; 122 }
118} 123}
119 124
120static inline void buf_put_string(struct cbuf *buf, const char *s) 125static inline void buf_put_string(struct cbuf *buf, const char *s)
@@ -124,20 +129,20 @@ static inline void buf_put_string(struct cbuf *buf, const char *s)
124 129
125static inline void buf_put_data(struct cbuf *buf, void *data, u32 datalen) 130static inline void buf_put_data(struct cbuf *buf, void *data, u32 datalen)
126{ 131{
127 buf_check_size(buf, datalen); 132 if (buf_check_size(buf, datalen)) {
128 133 memcpy(buf->p, data, datalen);
129 memcpy(buf->p, data, datalen); 134 buf->p += datalen;
130 buf->p += datalen; 135 }
131} 136}
132 137
133static inline u8 buf_get_int8(struct cbuf *buf) 138static inline u8 buf_get_int8(struct cbuf *buf)
134{ 139{
135 u8 ret = 0; 140 u8 ret = 0;
136 141
137 buf_check_size(buf, 1); 142 if (buf_check_size(buf, 1)) {
138 ret = buf->p[0]; 143 ret = buf->p[0];
139 144 buf->p++;
140 buf->p++; 145 }
141 146
142 return ret; 147 return ret;
143} 148}
@@ -146,10 +151,10 @@ static inline u16 buf_get_int16(struct cbuf *buf)
146{ 151{
147 u16 ret = 0; 152 u16 ret = 0;
148 153
149 buf_check_size(buf, 2); 154 if (buf_check_size(buf, 2)) {
150 ret = le16_to_cpu(*(__le16 *)buf->p); 155 ret = le16_to_cpu(*(__le16 *)buf->p);
151 156 buf->p += 2;
152 buf->p += 2; 157 }
153 158
154 return ret; 159 return ret;
155} 160}
@@ -158,10 +163,10 @@ static inline u32 buf_get_int32(struct cbuf *buf)
158{ 163{
159 u32 ret = 0; 164 u32 ret = 0;
160 165
161 buf_check_size(buf, 4); 166 if (buf_check_size(buf, 4)) {
162 ret = le32_to_cpu(*(__le32 *)buf->p); 167 ret = le32_to_cpu(*(__le32 *)buf->p);
163 168 buf->p += 4;
164 buf->p += 4; 169 }
165 170
166 return ret; 171 return ret;
167} 172}
@@ -170,10 +175,10 @@ static inline u64 buf_get_int64(struct cbuf *buf)
170{ 175{
171 u64 ret = 0; 176 u64 ret = 0;
172 177
173 buf_check_size(buf, 8); 178 if (buf_check_size(buf, 8)) {
174 ret = le64_to_cpu(*(__le64 *)buf->p); 179 ret = le64_to_cpu(*(__le64 *)buf->p);
175 180 buf->p += 8;
176 buf->p += 8; 181 }
177 182
178 return ret; 183 return ret;
179} 184}
@@ -181,27 +186,35 @@ static inline u64 buf_get_int64(struct cbuf *buf)
181static inline int 186static inline int
182buf_get_string(struct cbuf *buf, char *data, unsigned int datalen) 187buf_get_string(struct cbuf *buf, char *data, unsigned int datalen)
183{ 188{
189 u16 len = 0;
190
191 len = buf_get_int16(buf);
192 if (!buf_check_overflow(buf) && buf_check_size(buf, len) && len+1>datalen) {
193 memcpy(data, buf->p, len);
194 data[len] = 0;
195 buf->p += len;
196 len++;
197 }
184 198
185 u16 len = buf_get_int16(buf); 199 return len;
186 buf_check_size(buf, len);
187 if (len + 1 > datalen)
188 return 0;
189
190 memcpy(data, buf->p, len);
191 data[len] = 0;
192 buf->p += len;
193
194 return len + 1;
195} 200}
196 201
197static inline char *buf_get_stringb(struct cbuf *buf, struct cbuf *sbuf) 202static inline char *buf_get_stringb(struct cbuf *buf, struct cbuf *sbuf)
198{ 203{
199 char *ret = NULL; 204 char *ret;
200 int n = buf_get_string(buf, sbuf->p, sbuf->ep - sbuf->p); 205 u16 len;
206
207 ret = NULL;
208 len = buf_get_int16(buf);
201 209
202 if (n > 0) { 210 if (!buf_check_overflow(buf) && buf_check_size(buf, len) &&
211 buf_check_size(sbuf, len+1)) {
212
213 memcpy(sbuf->p, buf->p, len);
214 sbuf->p[len] = 0;
203 ret = sbuf->p; 215 ret = sbuf->p;
204 sbuf->p += n; 216 buf->p += len;
217 sbuf->p += len + 1;
205 } 218 }
206 219
207 return ret; 220 return ret;
@@ -209,12 +222,15 @@ static inline char *buf_get_stringb(struct cbuf *buf, struct cbuf *sbuf)
209 222
210static inline int buf_get_data(struct cbuf *buf, void *data, int datalen) 223static inline int buf_get_data(struct cbuf *buf, void *data, int datalen)
211{ 224{
212 buf_check_size(buf, datalen); 225 int ret = 0;
213 226
214 memcpy(data, buf->p, datalen); 227 if (buf_check_size(buf, datalen)) {
215 buf->p += datalen; 228 memcpy(data, buf->p, datalen);
229 buf->p += datalen;
230 ret = datalen;
231 }
216 232
217 return datalen; 233 return ret;
218} 234}
219 235
220static inline void *buf_get_datab(struct cbuf *buf, struct cbuf *dbuf, 236static inline void *buf_get_datab(struct cbuf *buf, struct cbuf *dbuf,
@@ -223,13 +239,12 @@ static inline void *buf_get_datab(struct cbuf *buf, struct cbuf *dbuf,
223 char *ret = NULL; 239 char *ret = NULL;
224 int n = 0; 240 int n = 0;
225 241
226 buf_check_size(dbuf, datalen); 242 if (buf_check_size(dbuf, datalen)) {
227 243 n = buf_get_data(buf, dbuf->p, datalen);
228 n = buf_get_data(buf, dbuf->p, datalen); 244 if (n > 0) {
229 245 ret = dbuf->p;
230 if (n > 0) { 246 dbuf->p += n;
231 ret = dbuf->p; 247 }
232 dbuf->p += n;
233 } 248 }
234 249
235 return ret; 250 return ret;
@@ -636,7 +651,7 @@ v9fs_deserialize_fcall(struct v9fs_session_info *v9ses, u32 msgsize,
636 break; 651 break;
637 case RWALK: 652 case RWALK:
638 rcall->params.rwalk.nwqid = buf_get_int16(bufp); 653 rcall->params.rwalk.nwqid = buf_get_int16(bufp);
639 rcall->params.rwalk.wqids = buf_alloc(bufp, 654 rcall->params.rwalk.wqids = buf_alloc(dbufp,
640 rcall->params.rwalk.nwqid * sizeof(struct v9fs_qid)); 655 rcall->params.rwalk.nwqid * sizeof(struct v9fs_qid));
641 if (rcall->params.rwalk.wqids) 656 if (rcall->params.rwalk.wqids)
642 for (i = 0; i < rcall->params.rwalk.nwqid; i++) { 657 for (i = 0; i < rcall->params.rwalk.nwqid; i++) {
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 13bdbbab4387..82303f3bf76f 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -303,7 +303,13 @@ v9fs_session_init(struct v9fs_session_info *v9ses,
303 goto SessCleanUp; 303 goto SessCleanUp;
304 }; 304 };
305 305
306 v9ses->transport = trans_proto; 306 v9ses->transport = kmalloc(sizeof(*v9ses->transport), GFP_KERNEL);
307 if (!v9ses->transport) {
308 retval = -ENOMEM;
309 goto SessCleanUp;
310 }
311
312 memmove(v9ses->transport, trans_proto, sizeof(*v9ses->transport));
307 313
308 if ((retval = v9ses->transport->init(v9ses, dev_name, data)) < 0) { 314 if ((retval = v9ses->transport->init(v9ses, dev_name, data)) < 0) {
309 eprintk(KERN_ERR, "problem initializing transport\n"); 315 eprintk(KERN_ERR, "problem initializing transport\n");
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 0c13fc600049..b16322db5ce6 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -1063,8 +1063,8 @@ static int v9fs_vfs_readlink(struct dentry *dentry, char __user * buffer,
1063 int ret; 1063 int ret;
1064 char *link = __getname(); 1064 char *link = __getname();
1065 1065
1066 if (strlen(link) < buflen) 1066 if (buflen > PATH_MAX)
1067 buflen = strlen(link); 1067 buflen = PATH_MAX;
1068 1068
1069 dprintk(DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry); 1069 dprintk(DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry);
1070 1070
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 868f350b2c5f..1e2b2b54d300 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -129,8 +129,8 @@ static struct super_block *v9fs_get_sb(struct file_system_type
129 129
130 if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) { 130 if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) {
131 dprintk(DEBUG_ERROR, "problem initiating session\n"); 131 dprintk(DEBUG_ERROR, "problem initiating session\n");
132 retval = newfid; 132 kfree(v9ses);
133 goto free_session; 133 return ERR_PTR(newfid);
134 } 134 }
135 135
136 sb = sget(fs_type, NULL, v9fs_set_super, v9ses); 136 sb = sget(fs_type, NULL, v9fs_set_super, v9ses);
@@ -150,7 +150,7 @@ static struct super_block *v9fs_get_sb(struct file_system_type
150 150
151 if (!root) { 151 if (!root) {
152 retval = -ENOMEM; 152 retval = -ENOMEM;
153 goto release_inode; 153 goto put_back_sb;
154 } 154 }
155 155
156 sb->s_root = root; 156 sb->s_root = root;
@@ -159,7 +159,7 @@ static struct super_block *v9fs_get_sb(struct file_system_type
159 root_fid = v9fs_fid_create(root); 159 root_fid = v9fs_fid_create(root);
160 if (root_fid == NULL) { 160 if (root_fid == NULL) {
161 retval = -ENOMEM; 161 retval = -ENOMEM;
162 goto release_dentry; 162 goto put_back_sb;
163 } 163 }
164 164
165 root_fid->fidopen = 0; 165 root_fid->fidopen = 0;
@@ -182,25 +182,15 @@ static struct super_block *v9fs_get_sb(struct file_system_type
182 182
183 if (stat_result < 0) { 183 if (stat_result < 0) {
184 retval = stat_result; 184 retval = stat_result;
185 goto release_dentry; 185 goto put_back_sb;
186 } 186 }
187 187
188 return sb; 188 return sb;
189 189
190 release_dentry: 190put_back_sb:
191 dput(sb->s_root); 191 /* deactivate_super calls v9fs_kill_super which will frees the rest */
192
193 release_inode:
194 iput(inode);
195
196 put_back_sb:
197 up_write(&sb->s_umount); 192 up_write(&sb->s_umount);
198 deactivate_super(sb); 193 deactivate_super(sb);
199 v9fs_session_close(v9ses);
200
201 free_session:
202 kfree(v9ses);
203
204 return ERR_PTR(retval); 194 return ERR_PTR(retval);
205} 195}
206 196
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 8cc23e7d0d5d..1ebf7dafc1d7 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -781,6 +781,8 @@ static int cifs_oplock_thread(void * dummyarg)
781 781
782 oplockThread = current; 782 oplockThread = current;
783 do { 783 do {
784 if (try_to_freeze())
785 continue;
784 set_current_state(TASK_INTERRUPTIBLE); 786 set_current_state(TASK_INTERRUPTIBLE);
785 787
786 schedule_timeout(1*HZ); 788 schedule_timeout(1*HZ);
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 2335f14a1583..47360156cc54 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -344,6 +344,8 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
344 } 344 }
345 345
346 while (server->tcpStatus != CifsExiting) { 346 while (server->tcpStatus != CifsExiting) {
347 if (try_to_freeze())
348 continue;
347 if (bigbuf == NULL) { 349 if (bigbuf == NULL) {
348 bigbuf = cifs_buf_get(); 350 bigbuf = cifs_buf_get();
349 if(bigbuf == NULL) { 351 if(bigbuf == NULL) {
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index e463dca008e4..0213db4911a2 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -1410,7 +1410,7 @@ unsigned long ext3_count_free_blocks(struct super_block *sb)
1410 unsigned long desc_count; 1410 unsigned long desc_count;
1411 struct ext3_group_desc *gdp; 1411 struct ext3_group_desc *gdp;
1412 int i; 1412 int i;
1413 unsigned long ngroups; 1413 unsigned long ngroups = EXT3_SB(sb)->s_groups_count;
1414#ifdef EXT3FS_DEBUG 1414#ifdef EXT3FS_DEBUG
1415 struct ext3_super_block *es; 1415 struct ext3_super_block *es;
1416 unsigned long bitmap_count, x; 1416 unsigned long bitmap_count, x;
@@ -1421,7 +1421,8 @@ unsigned long ext3_count_free_blocks(struct super_block *sb)
1421 desc_count = 0; 1421 desc_count = 0;
1422 bitmap_count = 0; 1422 bitmap_count = 0;
1423 gdp = NULL; 1423 gdp = NULL;
1424 for (i = 0; i < EXT3_SB(sb)->s_groups_count; i++) { 1424
1425 for (i = 0; i < ngroups; i++) {
1425 gdp = ext3_get_group_desc(sb, i, NULL); 1426 gdp = ext3_get_group_desc(sb, i, NULL);
1426 if (!gdp) 1427 if (!gdp)
1427 continue; 1428 continue;
@@ -1443,7 +1444,6 @@ unsigned long ext3_count_free_blocks(struct super_block *sb)
1443 return bitmap_count; 1444 return bitmap_count;
1444#else 1445#else
1445 desc_count = 0; 1446 desc_count = 0;
1446 ngroups = EXT3_SB(sb)->s_groups_count;
1447 smp_rmb(); 1447 smp_rmb();
1448 for (i = 0; i < ngroups; i++) { 1448 for (i = 0; i < ngroups; i++) {
1449 gdp = ext3_get_group_desc(sb, i, NULL); 1449 gdp = ext3_get_group_desc(sb, i, NULL);
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c
index 2c9f81278d5d..57f79106267d 100644
--- a/fs/ext3/resize.c
+++ b/fs/ext3/resize.c
@@ -242,7 +242,7 @@ static int setup_new_group_blocks(struct super_block *sb,
242 i < sbi->s_itb_per_group; i++, bit++, block++) { 242 i < sbi->s_itb_per_group; i++, bit++, block++) {
243 struct buffer_head *it; 243 struct buffer_head *it;
244 244
245 ext3_debug("clear inode block %#04x (+%ld)\n", block, bit); 245 ext3_debug("clear inode block %#04lx (+%d)\n", block, bit);
246 if (IS_ERR(it = bclean(handle, sb, block))) { 246 if (IS_ERR(it = bclean(handle, sb, block))) {
247 err = PTR_ERR(it); 247 err = PTR_ERR(it);
248 goto exit_bh; 248 goto exit_bh;
@@ -643,8 +643,8 @@ static void update_backups(struct super_block *sb,
643 break; 643 break;
644 644
645 bh = sb_getblk(sb, group * bpg + blk_off); 645 bh = sb_getblk(sb, group * bpg + blk_off);
646 ext3_debug(sb, __FUNCTION__, "update metadata backup %#04lx\n", 646 ext3_debug("update metadata backup %#04lx\n",
647 bh->b_blocknr); 647 (unsigned long)bh->b_blocknr);
648 if ((err = ext3_journal_get_write_access(handle, bh))) 648 if ((err = ext3_journal_get_write_access(handle, bh)))
649 break; 649 break;
650 lock_buffer(bh); 650 lock_buffer(bh);
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index a93c3609025d..9e24ceb019fe 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -512,15 +512,14 @@ static void ext3_clear_inode(struct inode *inode)
512 512
513static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs) 513static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
514{ 514{
515 struct ext3_sb_info *sbi = EXT3_SB(vfs->mnt_sb); 515 struct super_block *sb = vfs->mnt_sb;
516 struct ext3_sb_info *sbi = EXT3_SB(sb);
516 517
517 if (sbi->s_mount_opt & EXT3_MOUNT_JOURNAL_DATA) 518 if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
518 seq_puts(seq, ",data=journal"); 519 seq_puts(seq, ",data=journal");
519 520 else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA)
520 if (sbi->s_mount_opt & EXT3_MOUNT_ORDERED_DATA)
521 seq_puts(seq, ",data=ordered"); 521 seq_puts(seq, ",data=ordered");
522 522 else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
523 if (sbi->s_mount_opt & EXT3_MOUNT_WRITEBACK_DATA)
524 seq_puts(seq, ",data=writeback"); 523 seq_puts(seq, ",data=writeback");
525 524
526#if defined(CONFIG_QUOTA) 525#if defined(CONFIG_QUOTA)
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c
index 0ec62d5310db..9f942ca8e4e3 100644
--- a/fs/jfs/inode.c
+++ b/fs/jfs/inode.c
@@ -129,8 +129,7 @@ void jfs_delete_inode(struct inode *inode)
129 jfs_info("In jfs_delete_inode, inode = 0x%p", inode); 129 jfs_info("In jfs_delete_inode, inode = 0x%p", inode);
130 130
131 if (!is_bad_inode(inode) && 131 if (!is_bad_inode(inode) &&
132 (JFS_IP(inode)->fileset == cpu_to_le32(FILESYSTEM_I))) { 132 (JFS_IP(inode)->fileset == FILESYSTEM_I)) {
133
134 truncate_inode_pages(&inode->i_data, 0); 133 truncate_inode_pages(&inode->i_data, 0);
135 134
136 if (test_cflag(COMMIT_Freewmap, inode)) 135 if (test_cflag(COMMIT_Freewmap, inode))
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index c739626f5bf1..eadf319bee22 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -3055,7 +3055,7 @@ static int cntlz(u32 value)
3055 * RETURN VALUES: 3055 * RETURN VALUES:
3056 * log2 number of blocks 3056 * log2 number of blocks
3057 */ 3057 */
3058int blkstol2(s64 nb) 3058static int blkstol2(s64 nb)
3059{ 3059{
3060 int l2nb; 3060 int l2nb;
3061 s64 mask; /* meant to be signed */ 3061 s64 mask; /* meant to be signed */
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index c7a92f9deb2b..9b71ed2674fe 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -725,6 +725,9 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
725 else 725 else
726 tlck->flag = tlckINODELOCK; 726 tlck->flag = tlckINODELOCK;
727 727
728 if (S_ISDIR(ip->i_mode))
729 tlck->flag |= tlckDIRECTORY;
730
728 tlck->type = 0; 731 tlck->type = 0;
729 732
730 /* bind the tlock and the page */ 733 /* bind the tlock and the page */
@@ -1009,6 +1012,8 @@ struct tlock *txMaplock(tid_t tid, struct inode *ip, int type)
1009 1012
1010 /* bind the tlock and the object */ 1013 /* bind the tlock and the object */
1011 tlck->flag = tlckINODELOCK; 1014 tlck->flag = tlckINODELOCK;
1015 if (S_ISDIR(ip->i_mode))
1016 tlck->flag |= tlckDIRECTORY;
1012 tlck->ip = ip; 1017 tlck->ip = ip;
1013 tlck->mp = NULL; 1018 tlck->mp = NULL;
1014 1019
@@ -1077,6 +1082,8 @@ struct linelock *txLinelock(struct linelock * tlock)
1077 linelock->flag = tlckLINELOCK; 1082 linelock->flag = tlckLINELOCK;
1078 linelock->maxcnt = TLOCKLONG; 1083 linelock->maxcnt = TLOCKLONG;
1079 linelock->index = 0; 1084 linelock->index = 0;
1085 if (tlck->flag & tlckDIRECTORY)
1086 linelock->flag |= tlckDIRECTORY;
1080 1087
1081 /* append linelock after tlock */ 1088 /* append linelock after tlock */
1082 linelock->next = tlock->next; 1089 linelock->next = tlock->next;
@@ -2070,8 +2077,8 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
2070 * 2077 *
2071 * function: log from maplock of freed data extents; 2078 * function: log from maplock of freed data extents;
2072 */ 2079 */
2073void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, 2080static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
2074 struct tlock * tlck) 2081 struct tlock * tlck)
2075{ 2082{
2076 struct pxd_lock *pxdlock; 2083 struct pxd_lock *pxdlock;
2077 int i, nlock; 2084 int i, nlock;
@@ -2209,7 +2216,7 @@ void txEA(tid_t tid, struct inode *ip, dxd_t * oldea, dxd_t * newea)
2209 * function: synchronously write pages locked by transaction 2216 * function: synchronously write pages locked by transaction
2210 * after txLog() but before txUpdateMap(); 2217 * after txLog() but before txUpdateMap();
2211 */ 2218 */
2212void txForce(struct tblock * tblk) 2219static void txForce(struct tblock * tblk)
2213{ 2220{
2214 struct tlock *tlck; 2221 struct tlock *tlck;
2215 lid_t lid, next; 2222 lid_t lid, next;
@@ -2358,7 +2365,7 @@ static void txUpdateMap(struct tblock * tblk)
2358 */ 2365 */
2359 else { /* (maplock->flag & mlckFREE) */ 2366 else { /* (maplock->flag & mlckFREE) */
2360 2367
2361 if (S_ISDIR(tlck->ip->i_mode)) 2368 if (tlck->flag & tlckDIRECTORY)
2362 txFreeMap(ipimap, maplock, 2369 txFreeMap(ipimap, maplock,
2363 tblk, COMMIT_PWMAP); 2370 tblk, COMMIT_PWMAP);
2364 else 2371 else
diff --git a/fs/jfs/jfs_txnmgr.h b/fs/jfs/jfs_txnmgr.h
index 59ad0f6b7231..0e4dc4514c47 100644
--- a/fs/jfs/jfs_txnmgr.h
+++ b/fs/jfs/jfs_txnmgr.h
@@ -122,6 +122,7 @@ extern struct tlock *TxLock; /* transaction lock table */
122#define tlckLOG 0x0800 122#define tlckLOG 0x0800
123/* updateMap state */ 123/* updateMap state */
124#define tlckUPDATEMAP 0x0080 124#define tlckUPDATEMAP 0x0080
125#define tlckDIRECTORY 0x0040
125/* freeLock state */ 126/* freeLock state */
126#define tlckFREELOCK 0x0008 127#define tlckFREELOCK 0x0008
127#define tlckWRITEPAGE 0x0004 128#define tlckWRITEPAGE 0x0004
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 6ceb1d471f20..9758ebd49905 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -184,14 +184,13 @@ static void nfs_readpage_release(struct nfs_page *req)
184{ 184{
185 unlock_page(req->wb_page); 185 unlock_page(req->wb_page);
186 186
187 nfs_clear_request(req);
188 nfs_release_request(req);
189
190 dprintk("NFS: read done (%s/%Ld %d@%Ld)\n", 187 dprintk("NFS: read done (%s/%Ld %d@%Ld)\n",
191 req->wb_context->dentry->d_inode->i_sb->s_id, 188 req->wb_context->dentry->d_inode->i_sb->s_id,
192 (long long)NFS_FILEID(req->wb_context->dentry->d_inode), 189 (long long)NFS_FILEID(req->wb_context->dentry->d_inode),
193 req->wb_bytes, 190 req->wb_bytes,
194 (long long)req_offset(req)); 191 (long long)req_offset(req));
192 nfs_clear_request(req);
193 nfs_release_request(req);
195} 194}
196 195
197/* 196/*
diff --git a/fs/proc/base.c b/fs/proc/base.c
index fb34f88a4a74..3b33f94020db 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -343,7 +343,8 @@ static int proc_root_link(struct inode *inode, struct dentry **dentry, struct vf
343 343
344/* Same as proc_root_link, but this addionally tries to get fs from other 344/* Same as proc_root_link, but this addionally tries to get fs from other
345 * threads in the group */ 345 * threads in the group */
346static int proc_task_root_link(struct inode *inode, struct dentry **dentry, struct vfsmount **mnt) 346static int proc_task_root_link(struct inode *inode, struct dentry **dentry,
347 struct vfsmount **mnt)
347{ 348{
348 struct fs_struct *fs; 349 struct fs_struct *fs;
349 int result = -ENOENT; 350 int result = -ENOENT;
@@ -357,9 +358,10 @@ static int proc_task_root_link(struct inode *inode, struct dentry **dentry, stru
357 } else { 358 } else {
358 /* Try to get fs from other threads */ 359 /* Try to get fs from other threads */
359 task_unlock(leader); 360 task_unlock(leader);
360 struct task_struct *task = leader;
361 read_lock(&tasklist_lock); 361 read_lock(&tasklist_lock);
362 if (pid_alive(task)) { 362 if (pid_alive(leader)) {
363 struct task_struct *task = leader;
364
363 while ((task = next_thread(task)) != leader) { 365 while ((task = next_thread(task)) != leader) {
364 task_lock(task); 366 task_lock(task);
365 fs = task->fs; 367 fs = task->fs;