aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-25 22:26:14 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-25 22:26:14 -0500
commit91e229bbad6524aabaac8717b2f559283670c37a (patch)
tree84a55e4ac2dcf23add97bd9fde3e9cb232c12b30 /fs
parent6e5e93424dc66542c548dfaa3bfebe30d46d50dd (diff)
parentbfa274e2436fc7ef72ef51c878083647f1cfd429 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'fs')
-rw-r--r--fs/bio.c2
-rw-r--r--fs/block_dev.c201
-rw-r--r--fs/dlm/rcom.c2
-rw-r--r--fs/efs/dir.c2
-rw-r--r--fs/efs/efs.h140
-rw-r--r--fs/efs/file.c2
-rw-r--r--fs/efs/inode.c4
-rw-r--r--fs/efs/namei.c2
-rw-r--r--fs/efs/super.c7
-rw-r--r--fs/efs/symlink.c2
-rw-r--r--fs/fuse/dir.c2
-rw-r--r--fs/lockd/svc.c2
-rw-r--r--fs/nfs/callback.c3
-rw-r--r--fs/nfs/callback_xdr.c6
-rw-r--r--fs/nfs/delegation.c2
-rw-r--r--fs/nfs/idmap.c2
-rw-r--r--fs/nfs/nfs4state.c2
-rw-r--r--fs/nfsd/nfsfh.c2
-rw-r--r--fs/proc/base.c1
-rw-r--r--fs/proc/task_mmu.c2
-rw-r--r--fs/ufs/util.h2
21 files changed, 170 insertions, 220 deletions
diff --git a/fs/bio.c b/fs/bio.c
index 242e409dab4b..3312fcc3c098 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -903,7 +903,7 @@ void bio_set_pages_dirty(struct bio *bio)
903 } 903 }
904} 904}
905 905
906void bio_release_pages(struct bio *bio) 906static void bio_release_pages(struct bio *bio)
907{ 907{
908 struct bio_vec *bvec = bio->bi_io_vec; 908 struct bio_vec *bvec = bio->bi_io_vec;
909 int i; 909 int i;
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 67fe72ce6ac7..7d822fae7765 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -31,6 +31,8 @@ struct bdev_inode {
31 struct inode vfs_inode; 31 struct inode vfs_inode;
32}; 32};
33 33
34static const struct address_space_operations def_blk_aops;
35
34static inline struct bdev_inode *BDEV_I(struct inode *inode) 36static inline struct bdev_inode *BDEV_I(struct inode *inode)
35{ 37{
36 return container_of(inode, struct bdev_inode, vfs_inode); 38 return container_of(inode, struct bdev_inode, vfs_inode);
@@ -171,203 +173,6 @@ blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
171 iov, offset, nr_segs, blkdev_get_blocks, NULL); 173 iov, offset, nr_segs, blkdev_get_blocks, NULL);
172} 174}
173 175
174#if 0
175static void blk_end_aio(struct bio *bio, int error)
176{
177 struct kiocb *iocb = bio->bi_private;
178 atomic_t *bio_count = &iocb->ki_bio_count;
179
180 if (bio_data_dir(bio) == READ)
181 bio_check_pages_dirty(bio);
182 else {
183 bio_release_pages(bio);
184 bio_put(bio);
185 }
186
187 /* iocb->ki_nbytes stores error code from LLDD */
188 if (error)
189 iocb->ki_nbytes = -EIO;
190
191 if (atomic_dec_and_test(bio_count)) {
192 if ((long)iocb->ki_nbytes < 0)
193 aio_complete(iocb, iocb->ki_nbytes, 0);
194 else
195 aio_complete(iocb, iocb->ki_left, 0);
196 }
197
198 return 0;
199}
200
201#define VEC_SIZE 16
202struct pvec {
203 unsigned short nr;
204 unsigned short idx;
205 struct page *page[VEC_SIZE];
206};
207
208#define PAGES_SPANNED(addr, len) \
209 (DIV_ROUND_UP((addr) + (len), PAGE_SIZE) - (addr) / PAGE_SIZE);
210
211/*
212 * get page pointer for user addr, we internally cache struct page array for
213 * (addr, count) range in pvec to avoid frequent call to get_user_pages. If
214 * internal page list is exhausted, a batch count of up to VEC_SIZE is used
215 * to get next set of page struct.
216 */
217static struct page *blk_get_page(unsigned long addr, size_t count, int rw,
218 struct pvec *pvec)
219{
220 int ret, nr_pages;
221 if (pvec->idx == pvec->nr) {
222 nr_pages = PAGES_SPANNED(addr, count);
223 nr_pages = min(nr_pages, VEC_SIZE);
224 down_read(&current->mm->mmap_sem);
225 ret = get_user_pages(current, current->mm, addr, nr_pages,
226 rw == READ, 0, pvec->page, NULL);
227 up_read(&current->mm->mmap_sem);
228 if (ret < 0)
229 return ERR_PTR(ret);
230 pvec->nr = ret;
231 pvec->idx = 0;
232 }
233 return pvec->page[pvec->idx++];
234}
235
236/* return a page back to pvec array */
237static void blk_unget_page(struct page *page, struct pvec *pvec)
238{
239 pvec->page[--pvec->idx] = page;
240}
241
242static ssize_t
243blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
244 loff_t pos, unsigned long nr_segs)
245{
246 struct inode *inode = iocb->ki_filp->f_mapping->host;
247 unsigned blkbits = blksize_bits(bdev_hardsect_size(I_BDEV(inode)));
248 unsigned blocksize_mask = (1 << blkbits) - 1;
249 unsigned long seg = 0; /* iov segment iterator */
250 unsigned long nvec; /* number of bio vec needed */
251 unsigned long cur_off; /* offset into current page */
252 unsigned long cur_len; /* I/O len of current page, up to PAGE_SIZE */
253
254 unsigned long addr; /* user iovec address */
255 size_t count; /* user iovec len */
256 size_t nbytes = iocb->ki_nbytes = iocb->ki_left; /* total xfer size */
257 loff_t size; /* size of block device */
258 struct bio *bio;
259 atomic_t *bio_count = &iocb->ki_bio_count;
260 struct page *page;
261 struct pvec pvec;
262
263 pvec.nr = 0;
264 pvec.idx = 0;
265
266 if (pos & blocksize_mask)
267 return -EINVAL;
268
269 size = i_size_read(inode);
270 if (pos + nbytes > size) {
271 nbytes = size - pos;
272 iocb->ki_left = nbytes;
273 }
274
275 /*
276 * check first non-zero iov alignment, the remaining
277 * iov alignment is checked inside bio loop below.
278 */
279 do {
280 addr = (unsigned long) iov[seg].iov_base;
281 count = min(iov[seg].iov_len, nbytes);
282 if (addr & blocksize_mask || count & blocksize_mask)
283 return -EINVAL;
284 } while (!count && ++seg < nr_segs);
285 atomic_set(bio_count, 1);
286
287 while (nbytes) {
288 /* roughly estimate number of bio vec needed */
289 nvec = (nbytes + PAGE_SIZE - 1) / PAGE_SIZE;
290 nvec = max(nvec, nr_segs - seg);
291 nvec = min(nvec, (unsigned long) BIO_MAX_PAGES);
292
293 /* bio_alloc should not fail with GFP_KERNEL flag */
294 bio = bio_alloc(GFP_KERNEL, nvec);
295 bio->bi_bdev = I_BDEV(inode);
296 bio->bi_end_io = blk_end_aio;
297 bio->bi_private = iocb;
298 bio->bi_sector = pos >> blkbits;
299same_bio:
300 cur_off = addr & ~PAGE_MASK;
301 cur_len = PAGE_SIZE - cur_off;
302 if (count < cur_len)
303 cur_len = count;
304
305 page = blk_get_page(addr, count, rw, &pvec);
306 if (unlikely(IS_ERR(page)))
307 goto backout;
308
309 if (bio_add_page(bio, page, cur_len, cur_off)) {
310 pos += cur_len;
311 addr += cur_len;
312 count -= cur_len;
313 nbytes -= cur_len;
314
315 if (count)
316 goto same_bio;
317 while (++seg < nr_segs) {
318 addr = (unsigned long) iov[seg].iov_base;
319 count = iov[seg].iov_len;
320 if (!count)
321 continue;
322 if (unlikely(addr & blocksize_mask ||
323 count & blocksize_mask)) {
324 page = ERR_PTR(-EINVAL);
325 goto backout;
326 }
327 count = min(count, nbytes);
328 goto same_bio;
329 }
330 } else {
331 blk_unget_page(page, &pvec);
332 }
333
334 /* bio is ready, submit it */
335 if (rw == READ)
336 bio_set_pages_dirty(bio);
337 atomic_inc(bio_count);
338 submit_bio(rw, bio);
339 }
340
341completion:
342 iocb->ki_left -= nbytes;
343 nbytes = iocb->ki_left;
344 iocb->ki_pos += nbytes;
345
346 blk_run_address_space(inode->i_mapping);
347 if (atomic_dec_and_test(bio_count))
348 aio_complete(iocb, nbytes, 0);
349
350 return -EIOCBQUEUED;
351
352backout:
353 /*
354 * back out nbytes count constructed so far for this bio,
355 * we will throw away current bio.
356 */
357 nbytes += bio->bi_size;
358 bio_release_pages(bio);
359 bio_put(bio);
360
361 /*
362 * if no bio was submmitted, return the error code.
363 * otherwise, proceed with pending I/O completion.
364 */
365 if (atomic_read(bio_count) == 1)
366 return PTR_ERR(page);
367 goto completion;
368}
369#endif
370
371static int blkdev_writepage(struct page *page, struct writeback_control *wbc) 176static int blkdev_writepage(struct page *page, struct writeback_control *wbc)
372{ 177{
373 return block_write_full_page(page, blkdev_get_block, wbc); 178 return block_write_full_page(page, blkdev_get_block, wbc);
@@ -1334,7 +1139,7 @@ static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
1334 return blkdev_ioctl(file->f_mapping->host, file, cmd, arg); 1139 return blkdev_ioctl(file->f_mapping->host, file, cmd, arg);
1335} 1140}
1336 1141
1337const struct address_space_operations def_blk_aops = { 1142static const struct address_space_operations def_blk_aops = {
1338 .readpage = blkdev_readpage, 1143 .readpage = blkdev_readpage,
1339 .writepage = blkdev_writepage, 1144 .writepage = blkdev_writepage,
1340 .sync_page = block_sync_page, 1145 .sync_page = block_sync_page,
diff --git a/fs/dlm/rcom.c b/fs/dlm/rcom.c
index 035e6f9990b0..67522c268c14 100644
--- a/fs/dlm/rcom.c
+++ b/fs/dlm/rcom.c
@@ -215,6 +215,8 @@ int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name, int last_len)
215 ls->ls_recover_nodeid = nodeid; 215 ls->ls_recover_nodeid = nodeid;
216 216
217 if (nodeid == dlm_our_nodeid()) { 217 if (nodeid == dlm_our_nodeid()) {
218 ls->ls_recover_buf->rc_header.h_length =
219 dlm_config.ci_buffer_size;
218 dlm_copy_master_names(ls, last_name, last_len, 220 dlm_copy_master_names(ls, last_name, last_len,
219 ls->ls_recover_buf->rc_buf, 221 ls->ls_recover_buf->rc_buf,
220 max_size, nodeid); 222 max_size, nodeid);
diff --git a/fs/efs/dir.c b/fs/efs/dir.c
index dfb5cb400217..49308a29798a 100644
--- a/fs/efs/dir.c
+++ b/fs/efs/dir.c
@@ -5,8 +5,8 @@
5 */ 5 */
6 6
7#include <linux/buffer_head.h> 7#include <linux/buffer_head.h>
8#include <linux/efs_fs.h>
9#include <linux/smp_lock.h> 8#include <linux/smp_lock.h>
9#include "efs.h"
10 10
11static int efs_readdir(struct file *, void *, filldir_t); 11static int efs_readdir(struct file *, void *, filldir_t);
12 12
diff --git a/fs/efs/efs.h b/fs/efs/efs.h
new file mode 100644
index 000000000000..d8305b582ab0
--- /dev/null
+++ b/fs/efs/efs.h
@@ -0,0 +1,140 @@
1/*
2 * Copyright (c) 1999 Al Smith
3 *
4 * Portions derived from work (c) 1995,1996 Christian Vogelgsang.
5 * Portions derived from IRIX header files (c) 1988 Silicon Graphics
6 */
7#ifndef _EFS_EFS_H_
8#define _EFS_EFS_H_
9
10#include <linux/fs.h>
11#include <asm/uaccess.h>
12
13#define EFS_VERSION "1.0a"
14
15static const char cprt[] = "EFS: "EFS_VERSION" - (c) 1999 Al Smith <Al.Smith@aeschi.ch.eu.org>";
16
17
18/* 1 block is 512 bytes */
19#define EFS_BLOCKSIZE_BITS 9
20#define EFS_BLOCKSIZE (1 << EFS_BLOCKSIZE_BITS)
21
22typedef int32_t efs_block_t;
23typedef uint32_t efs_ino_t;
24
25#define EFS_DIRECTEXTENTS 12
26
27/*
28 * layout of an extent, in memory and on disk. 8 bytes exactly.
29 */
30typedef union extent_u {
31 unsigned char raw[8];
32 struct extent_s {
33 unsigned int ex_magic:8; /* magic # (zero) */
34 unsigned int ex_bn:24; /* basic block */
35 unsigned int ex_length:8; /* numblocks in this extent */
36 unsigned int ex_offset:24; /* logical offset into file */
37 } cooked;
38} efs_extent;
39
40typedef struct edevs {
41 __be16 odev;
42 __be32 ndev;
43} efs_devs;
44
45/*
46 * extent based filesystem inode as it appears on disk. The efs inode
47 * is exactly 128 bytes long.
48 */
49struct efs_dinode {
50 __be16 di_mode; /* mode and type of file */
51 __be16 di_nlink; /* number of links to file */
52 __be16 di_uid; /* owner's user id */
53 __be16 di_gid; /* owner's group id */
54 __be32 di_size; /* number of bytes in file */
55 __be32 di_atime; /* time last accessed */
56 __be32 di_mtime; /* time last modified */
57 __be32 di_ctime; /* time created */
58 __be32 di_gen; /* generation number */
59 __be16 di_numextents; /* # of extents */
60 u_char di_version; /* version of inode */
61 u_char di_spare; /* spare - used by AFS */
62 union di_addr {
63 efs_extent di_extents[EFS_DIRECTEXTENTS];
64 efs_devs di_dev; /* device for IFCHR/IFBLK */
65 } di_u;
66};
67
68/* efs inode storage in memory */
69struct efs_inode_info {
70 int numextents;
71 int lastextent;
72
73 efs_extent extents[EFS_DIRECTEXTENTS];
74 struct inode vfs_inode;
75};
76
77#include <linux/efs_fs_sb.h>
78
79#define EFS_DIRBSIZE_BITS EFS_BLOCKSIZE_BITS
80#define EFS_DIRBSIZE (1 << EFS_DIRBSIZE_BITS)
81
82struct efs_dentry {
83 __be32 inode;
84 unsigned char namelen;
85 char name[3];
86};
87
88#define EFS_DENTSIZE (sizeof(struct efs_dentry) - 3 + 1)
89#define EFS_MAXNAMELEN ((1 << (sizeof(char) * 8)) - 1)
90
91#define EFS_DIRBLK_HEADERSIZE 4
92#define EFS_DIRBLK_MAGIC 0xbeef /* moo */
93
94struct efs_dir {
95 __be16 magic;
96 unsigned char firstused;
97 unsigned char slots;
98
99 unsigned char space[EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE];
100};
101
102#define EFS_MAXENTS \
103 ((EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE) / \
104 (EFS_DENTSIZE + sizeof(char)))
105
106#define EFS_SLOTAT(dir, slot) EFS_REALOFF((dir)->space[slot])
107
108#define EFS_REALOFF(offset) ((offset << 1))
109
110
111static inline struct efs_inode_info *INODE_INFO(struct inode *inode)
112{
113 return container_of(inode, struct efs_inode_info, vfs_inode);
114}
115
116static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb)
117{
118 return sb->s_fs_info;
119}
120
121struct statfs;
122struct fid;
123
124extern const struct inode_operations efs_dir_inode_operations;
125extern const struct file_operations efs_dir_operations;
126extern const struct address_space_operations efs_symlink_aops;
127
128extern struct inode *efs_iget(struct super_block *, unsigned long);
129extern efs_block_t efs_map_block(struct inode *, efs_block_t);
130extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int);
131
132extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *);
133extern struct dentry *efs_fh_to_dentry(struct super_block *sb, struct fid *fid,
134 int fh_len, int fh_type);
135extern struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid,
136 int fh_len, int fh_type);
137extern struct dentry *efs_get_parent(struct dentry *);
138extern int efs_bmap(struct inode *, int);
139
140#endif /* _EFS_EFS_H_ */
diff --git a/fs/efs/file.c b/fs/efs/file.c
index 5db20129681e..1ccb364ffa63 100644
--- a/fs/efs/file.c
+++ b/fs/efs/file.c
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#include <linux/buffer_head.h> 9#include <linux/buffer_head.h>
10#include <linux/efs_fs.h> 10#include "efs.h"
11 11
12int efs_get_block(struct inode *inode, sector_t iblock, 12int efs_get_block(struct inode *inode, sector_t iblock,
13 struct buffer_head *bh_result, int create) 13 struct buffer_head *bh_result, int create)
diff --git a/fs/efs/inode.c b/fs/efs/inode.c
index 627c3026946d..79e19e5958e1 100644
--- a/fs/efs/inode.c
+++ b/fs/efs/inode.c
@@ -7,11 +7,11 @@
7 * and from work (c) 1998 Mike Shaver. 7 * and from work (c) 1998 Mike Shaver.
8 */ 8 */
9 9
10#include <linux/efs_fs.h>
11#include <linux/efs_fs_sb.h>
12#include <linux/buffer_head.h> 10#include <linux/buffer_head.h>
13#include <linux/module.h> 11#include <linux/module.h>
14#include <linux/fs.h> 12#include <linux/fs.h>
13#include "efs.h"
14#include <linux/efs_fs_sb.h>
15 15
16static int efs_readpage(struct file *file, struct page *page) 16static int efs_readpage(struct file *file, struct page *page)
17{ 17{
diff --git a/fs/efs/namei.c b/fs/efs/namei.c
index e26704742d41..3a404e7fad53 100644
--- a/fs/efs/namei.c
+++ b/fs/efs/namei.c
@@ -8,9 +8,9 @@
8 8
9#include <linux/buffer_head.h> 9#include <linux/buffer_head.h>
10#include <linux/string.h> 10#include <linux/string.h>
11#include <linux/efs_fs.h>
12#include <linux/smp_lock.h> 11#include <linux/smp_lock.h>
13#include <linux/exportfs.h> 12#include <linux/exportfs.h>
13#include "efs.h"
14 14
15 15
16static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int len) { 16static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int len) {
diff --git a/fs/efs/super.c b/fs/efs/super.c
index 14082405cdd1..d733531b55e2 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -8,14 +8,15 @@
8 8
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/efs_fs.h>
12#include <linux/efs_vh.h>
13#include <linux/efs_fs_sb.h>
14#include <linux/exportfs.h> 11#include <linux/exportfs.h>
15#include <linux/slab.h> 12#include <linux/slab.h>
16#include <linux/buffer_head.h> 13#include <linux/buffer_head.h>
17#include <linux/vfs.h> 14#include <linux/vfs.h>
18 15
16#include "efs.h"
17#include <linux/efs_vh.h>
18#include <linux/efs_fs_sb.h>
19
19static int efs_statfs(struct dentry *dentry, struct kstatfs *buf); 20static int efs_statfs(struct dentry *dentry, struct kstatfs *buf);
20static int efs_fill_super(struct super_block *s, void *d, int silent); 21static int efs_fill_super(struct super_block *s, void *d, int silent);
21 22
diff --git a/fs/efs/symlink.c b/fs/efs/symlink.c
index 1d30d2ff440f..41911ec83aaf 100644
--- a/fs/efs/symlink.c
+++ b/fs/efs/symlink.c
@@ -7,10 +7,10 @@
7 */ 7 */
8 8
9#include <linux/string.h> 9#include <linux/string.h>
10#include <linux/efs_fs.h>
11#include <linux/pagemap.h> 10#include <linux/pagemap.h>
12#include <linux/buffer_head.h> 11#include <linux/buffer_head.h>
13#include <linux/smp_lock.h> 12#include <linux/smp_lock.h>
13#include "efs.h"
14 14
15static int efs_symlink_readpage(struct file *file, struct page *page) 15static int efs_symlink_readpage(struct file *file, struct page *page)
16{ 16{
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 7fb514b6d852..c4807b3fc8a3 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -906,7 +906,7 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd)
906 } 906 }
907 907
908 if (fc->flags & FUSE_DEFAULT_PERMISSIONS) { 908 if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
909 int err = generic_permission(inode, mask, NULL); 909 err = generic_permission(inode, mask, NULL);
910 910
911 /* If permission is denied, try to refresh file 911 /* If permission is denied, try to refresh file
912 attributes. This is also needed, because the root 912 attributes. This is also needed, because the root
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 08226464e563..1ed8bd4de941 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -153,7 +153,7 @@ lockd(struct svc_rqst *rqstp)
153 */ 153 */
154 while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) { 154 while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) {
155 long timeout = MAX_SCHEDULE_TIMEOUT; 155 long timeout = MAX_SCHEDULE_TIMEOUT;
156 char buf[RPC_MAX_ADDRBUFLEN]; 156 RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
157 157
158 if (signalled()) { 158 if (signalled()) {
159 flush_signals(current); 159 flush_signals(current);
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index ecc06c619494..66648dd92d97 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -93,6 +93,7 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
93 svc_process(rqstp); 93 svc_process(rqstp);
94 } 94 }
95 95
96 flush_signals(current);
96 svc_exit_thread(rqstp); 97 svc_exit_thread(rqstp);
97 nfs_callback_info.pid = 0; 98 nfs_callback_info.pid = 0;
98 complete(&nfs_callback_info.stopped); 99 complete(&nfs_callback_info.stopped);
@@ -171,7 +172,7 @@ void nfs_callback_down(void)
171static int nfs_callback_authenticate(struct svc_rqst *rqstp) 172static int nfs_callback_authenticate(struct svc_rqst *rqstp)
172{ 173{
173 struct nfs_client *clp; 174 struct nfs_client *clp;
174 char buf[RPC_MAX_ADDRBUFLEN]; 175 RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
175 176
176 /* Don't talk to strangers */ 177 /* Don't talk to strangers */
177 clp = nfs_find_client(svc_addr(rqstp), 4); 178 clp = nfs_find_client(svc_addr(rqstp), 4);
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index c63eb720b68b..13619d24f023 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -254,7 +254,7 @@ static __be32 encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitmap,
254 if (!(bitmap[0] & FATTR4_WORD0_CHANGE)) 254 if (!(bitmap[0] & FATTR4_WORD0_CHANGE))
255 return 0; 255 return 0;
256 p = xdr_reserve_space(xdr, 8); 256 p = xdr_reserve_space(xdr, 8);
257 if (unlikely(p == 0)) 257 if (unlikely(!p))
258 return htonl(NFS4ERR_RESOURCE); 258 return htonl(NFS4ERR_RESOURCE);
259 p = xdr_encode_hyper(p, change); 259 p = xdr_encode_hyper(p, change);
260 return 0; 260 return 0;
@@ -267,7 +267,7 @@ static __be32 encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, u
267 if (!(bitmap[0] & FATTR4_WORD0_SIZE)) 267 if (!(bitmap[0] & FATTR4_WORD0_SIZE))
268 return 0; 268 return 0;
269 p = xdr_reserve_space(xdr, 8); 269 p = xdr_reserve_space(xdr, 8);
270 if (unlikely(p == 0)) 270 if (unlikely(!p))
271 return htonl(NFS4ERR_RESOURCE); 271 return htonl(NFS4ERR_RESOURCE);
272 p = xdr_encode_hyper(p, size); 272 p = xdr_encode_hyper(p, size);
273 return 0; 273 return 0;
@@ -278,7 +278,7 @@ static __be32 encode_attr_time(struct xdr_stream *xdr, const struct timespec *ti
278 __be32 *p; 278 __be32 *p;
279 279
280 p = xdr_reserve_space(xdr, 12); 280 p = xdr_reserve_space(xdr, 12);
281 if (unlikely(p == 0)) 281 if (unlikely(!p))
282 return htonl(NFS4ERR_RESOURCE); 282 return htonl(NFS4ERR_RESOURCE);
283 p = xdr_encode_hyper(p, time->tv_sec); 283 p = xdr_encode_hyper(p, time->tv_sec);
284 *p = htonl(time->tv_nsec); 284 *p = htonl(time->tv_nsec);
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index b9eadd18ba70..00a5e4405e16 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -49,7 +49,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
49 struct file_lock *fl; 49 struct file_lock *fl;
50 int status; 50 int status;
51 51
52 for (fl = inode->i_flock; fl != 0; fl = fl->fl_next) { 52 for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
53 if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) 53 if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
54 continue; 54 continue;
55 if (nfs_file_open_context(fl->fl_file) != ctx) 55 if (nfs_file_open_context(fl->fl_file) != ctx)
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index 8ae5dba2d4e5..86147b0ab2cf 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -309,7 +309,7 @@ nfs_idmap_name(struct idmap *idmap, struct idmap_hashtable *h,
309 mutex_lock(&idmap->idmap_im_lock); 309 mutex_lock(&idmap->idmap_im_lock);
310 310
311 he = idmap_lookup_id(h, id); 311 he = idmap_lookup_id(h, id);
312 if (he != 0) { 312 if (he) {
313 memcpy(name, he->ih_name, he->ih_namelen); 313 memcpy(name, he->ih_name, he->ih_namelen);
314 ret = he->ih_namelen; 314 ret = he->ih_namelen;
315 goto out; 315 goto out;
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 6233eb5e98c1..b962397004c1 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -785,7 +785,7 @@ static int nfs4_reclaim_locks(struct nfs4_state_recovery_ops *ops, struct nfs4_s
785 struct file_lock *fl; 785 struct file_lock *fl;
786 int status = 0; 786 int status = 0;
787 787
788 for (fl = inode->i_flock; fl != 0; fl = fl->fl_next) { 788 for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
789 if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) 789 if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
790 continue; 790 continue;
791 if (nfs_file_open_context(fl->fl_file)->state != state) 791 if (nfs_file_open_context(fl->fl_file)->state != state)
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 0130b345234d..1eb771d79cca 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -101,7 +101,7 @@ static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp,
101{ 101{
102 /* Check if the request originated from a secure port. */ 102 /* Check if the request originated from a secure port. */
103 if (!rqstp->rq_secure && EX_SECURE(exp)) { 103 if (!rqstp->rq_secure && EX_SECURE(exp)) {
104 char buf[RPC_MAX_ADDRBUFLEN]; 104 RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
105 dprintk(KERN_WARNING 105 dprintk(KERN_WARNING
106 "nfsd: request from insecure port %s!\n", 106 "nfsd: request from insecure port %s!\n",
107 svc_print_addr(rqstp, buf, sizeof(buf))); 107 svc_print_addr(rqstp, buf, sizeof(buf)));
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 88f8edf18258..96ee899d6502 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -416,6 +416,7 @@ static const struct limit_names lnames[RLIM_NLIMITS] = {
416 [RLIMIT_MSGQUEUE] = {"Max msgqueue size", "bytes"}, 416 [RLIMIT_MSGQUEUE] = {"Max msgqueue size", "bytes"},
417 [RLIMIT_NICE] = {"Max nice priority", NULL}, 417 [RLIMIT_NICE] = {"Max nice priority", NULL},
418 [RLIMIT_RTPRIO] = {"Max realtime priority", NULL}, 418 [RLIMIT_RTPRIO] = {"Max realtime priority", NULL},
419 [RLIMIT_RTTIME] = {"Max realtime timeout", "us"},
419}; 420};
420 421
421/* Display limits for a process */ 422/* Display limits for a process */
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 49958cffbd8d..6dc0334815f7 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -531,7 +531,7 @@ struct pagemapread {
531#define PM_RESERVED_BITS 3 531#define PM_RESERVED_BITS 3
532#define PM_RESERVED_OFFSET (64 - PM_RESERVED_BITS) 532#define PM_RESERVED_OFFSET (64 - PM_RESERVED_BITS)
533#define PM_RESERVED_MASK (((1LL<<PM_RESERVED_BITS)-1) << PM_RESERVED_OFFSET) 533#define PM_RESERVED_MASK (((1LL<<PM_RESERVED_BITS)-1) << PM_RESERVED_OFFSET)
534#define PM_SPECIAL(nr) (((nr) << PM_RESERVED_OFFSET) | PM_RESERVED_MASK) 534#define PM_SPECIAL(nr) (((nr) << PM_RESERVED_OFFSET) & PM_RESERVED_MASK)
535#define PM_NOT_PRESENT PM_SPECIAL(1LL) 535#define PM_NOT_PRESENT PM_SPECIAL(1LL)
536#define PM_SWAP PM_SPECIAL(2LL) 536#define PM_SWAP PM_SPECIAL(2LL)
537#define PM_END_OF_BUFFER 1 537#define PM_END_OF_BUFFER 1
diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index b26fc4dec1e7..23ceed8c8fb9 100644
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -58,7 +58,7 @@ ufs_set_fs_state(struct super_block *sb, struct ufs_super_block_first *usb1,
58{ 58{
59 switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { 59 switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
60 case UFS_ST_SUNOS: 60 case UFS_ST_SUNOS:
61 if (fs32_to_cpu(sb, usb3->fs_postblformat == UFS_42POSTBLFMT)) { 61 if (fs32_to_cpu(sb, usb3->fs_postblformat) == UFS_42POSTBLFMT) {
62 usb1->fs_u0.fs_sun.fs_state = cpu_to_fs32(sb, value); 62 usb1->fs_u0.fs_sun.fs_state = cpu_to_fs32(sb, value);
63 break; 63 break;
64 } 64 }