aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2008-11-26 06:03:54 -0500
committerMiklos Szeredi <miklos@szeredi.hu>2008-11-26 06:03:54 -0500
commit1729a16c2c92bbd9e54ac7cad3101fea2e073aa5 (patch)
tree6814c8f122d6e7e6993d3af6ea427b3958b9a4f2 /fs/fuse
parented313489badef16d700f5a3be50e8fd8f8294bc8 (diff)
fuse: style fixes
Fix coding style errors reported by checkpatch and others. Uptdate copyright date to 2008. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/control.c6
-rw-r--r--fs/fuse/dev.c22
-rw-r--r--fs/fuse/dir.c12
-rw-r--r--fs/fuse/file.c4
-rw-r--r--fs/fuse/fuse_i.h38
-rw-r--r--fs/fuse/inode.c19
6 files changed, 54 insertions, 47 deletions
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index 4f3cab321415..99c99dfb0373 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -1,6 +1,6 @@
1/* 1/*
2 FUSE: Filesystem in Userspace 2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> 3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
4 4
5 This program can be distributed under the terms of the GNU GPL. 5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING. 6 See the file COPYING.
@@ -48,11 +48,13 @@ static ssize_t fuse_conn_waiting_read(struct file *file, char __user *buf,
48 size_t size; 48 size_t size;
49 49
50 if (!*ppos) { 50 if (!*ppos) {
51 long value;
51 struct fuse_conn *fc = fuse_ctl_file_conn_get(file); 52 struct fuse_conn *fc = fuse_ctl_file_conn_get(file);
52 if (!fc) 53 if (!fc)
53 return 0; 54 return 0;
54 55
55 file->private_data=(void *)(long)atomic_read(&fc->num_waiting); 56 value = atomic_read(&fc->num_waiting);
57 file->private_data = (void *)value;
56 fuse_conn_put(fc); 58 fuse_conn_put(fc);
57 } 59 }
58 size = sprintf(tmp, "%ld\n", (long)file->private_data); 60 size = sprintf(tmp, "%ld\n", (long)file->private_data);
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index b72361479be2..85a23bb524f7 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1,6 +1,6 @@
1/* 1/*
2 FUSE: Filesystem in Userspace 2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> 3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
4 4
5 This program can be distributed under the terms of the GNU GPL. 5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING. 6 See the file COPYING.
@@ -539,8 +539,8 @@ static int fuse_copy_fill(struct fuse_copy_state *cs)
539 BUG_ON(!cs->nr_segs); 539 BUG_ON(!cs->nr_segs);
540 cs->seglen = cs->iov[0].iov_len; 540 cs->seglen = cs->iov[0].iov_len;
541 cs->addr = (unsigned long) cs->iov[0].iov_base; 541 cs->addr = (unsigned long) cs->iov[0].iov_base;
542 cs->iov ++; 542 cs->iov++;
543 cs->nr_segs --; 543 cs->nr_segs--;
544 } 544 }
545 down_read(&current->mm->mmap_sem); 545 down_read(&current->mm->mmap_sem);
546 err = get_user_pages(current, current->mm, cs->addr, 1, cs->write, 0, 546 err = get_user_pages(current, current->mm, cs->addr, 1, cs->write, 0,
@@ -589,9 +589,11 @@ static int fuse_copy_page(struct fuse_copy_state *cs, struct page *page,
589 kunmap_atomic(mapaddr, KM_USER1); 589 kunmap_atomic(mapaddr, KM_USER1);
590 } 590 }
591 while (count) { 591 while (count) {
592 int err; 592 if (!cs->len) {
593 if (!cs->len && (err = fuse_copy_fill(cs))) 593 int err = fuse_copy_fill(cs);
594 return err; 594 if (err)
595 return err;
596 }
595 if (page) { 597 if (page) {
596 void *mapaddr = kmap_atomic(page, KM_USER1); 598 void *mapaddr = kmap_atomic(page, KM_USER1);
597 void *buf = mapaddr + offset; 599 void *buf = mapaddr + offset;
@@ -631,9 +633,11 @@ static int fuse_copy_pages(struct fuse_copy_state *cs, unsigned nbytes,
631static int fuse_copy_one(struct fuse_copy_state *cs, void *val, unsigned size) 633static int fuse_copy_one(struct fuse_copy_state *cs, void *val, unsigned size)
632{ 634{
633 while (size) { 635 while (size) {
634 int err; 636 if (!cs->len) {
635 if (!cs->len && (err = fuse_copy_fill(cs))) 637 int err = fuse_copy_fill(cs);
636 return err; 638 if (err)
639 return err;
640 }
637 fuse_copy_do(cs, &val, &size); 641 fuse_copy_do(cs, &val, &size);
638 } 642 }
639 return 0; 643 return 0;
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index fd03330cadeb..9e7c5385699f 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1,6 +1,6 @@
1/* 1/*
2 FUSE: Filesystem in Userspace 2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> 3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
4 4
5 This program can be distributed under the terms of the GNU GPL. 5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING. 6 See the file COPYING.
@@ -204,7 +204,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
204 return 0; 204 return 0;
205 } 205 }
206 spin_lock(&fc->lock); 206 spin_lock(&fc->lock);
207 fi->nlookup ++; 207 fi->nlookup++;
208 spin_unlock(&fc->lock); 208 spin_unlock(&fc->lock);
209 } 209 }
210 fuse_put_request(fc, forget_req); 210 fuse_put_request(fc, forget_req);
@@ -637,9 +637,11 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry)
637 if (!err) { 637 if (!err) {
638 struct inode *inode = entry->d_inode; 638 struct inode *inode = entry->d_inode;
639 639
640 /* Set nlink to zero so the inode can be cleared, if 640 /*
641 the inode does have more links this will be 641 * Set nlink to zero so the inode can be cleared, if the inode
642 discovered at the next lookup/getattr */ 642 * does have more links this will be discovered at the next
643 * lookup/getattr.
644 */
643 clear_nlink(inode); 645 clear_nlink(inode);
644 fuse_invalidate_attr(inode); 646 fuse_invalidate_attr(inode);
645 fuse_invalidate_attr(dir); 647 fuse_invalidate_attr(dir);
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 34930a964b82..86054f437d1e 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1,6 +1,6 @@
1/* 1/*
2 FUSE: Filesystem in Userspace 2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> 3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
4 4
5 This program can be distributed under the terms of the GNU GPL. 5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING. 6 See the file COPYING.
@@ -543,7 +543,7 @@ static int fuse_readpages_fill(void *_data, struct page *page)
543 } 543 }
544 } 544 }
545 req->pages[req->num_pages] = page; 545 req->pages[req->num_pages] = page;
546 req->num_pages ++; 546 req->num_pages++;
547 return 0; 547 return 0;
548} 548}
549 549
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 35accfdd747f..4fc5131f5c9d 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -1,6 +1,6 @@
1/* 1/*
2 FUSE: Filesystem in Userspace 2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> 3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
4 4
5 This program can be distributed under the terms of the GNU GPL. 5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING. 6 See the file COPYING.
@@ -355,19 +355,19 @@ struct fuse_conn {
355 /** Connection failed (version mismatch). Cannot race with 355 /** Connection failed (version mismatch). Cannot race with
356 setting other bitfields since it is only set once in INIT 356 setting other bitfields since it is only set once in INIT
357 reply, before any other request, and never cleared */ 357 reply, before any other request, and never cleared */
358 unsigned conn_error : 1; 358 unsigned conn_error:1;
359 359
360 /** Connection successful. Only set in INIT */ 360 /** Connection successful. Only set in INIT */
361 unsigned conn_init : 1; 361 unsigned conn_init:1;
362 362
363 /** Do readpages asynchronously? Only set in INIT */ 363 /** Do readpages asynchronously? Only set in INIT */
364 unsigned async_read : 1; 364 unsigned async_read:1;
365 365
366 /** Do not send separate SETATTR request before open(O_TRUNC) */ 366 /** Do not send separate SETATTR request before open(O_TRUNC) */
367 unsigned atomic_o_trunc : 1; 367 unsigned atomic_o_trunc:1;
368 368
369 /** Filesystem supports NFS exporting. Only set in INIT */ 369 /** Filesystem supports NFS exporting. Only set in INIT */
370 unsigned export_support : 1; 370 unsigned export_support:1;
371 371
372 /* 372 /*
373 * The following bitfields are only for optimization purposes 373 * The following bitfields are only for optimization purposes
@@ -375,43 +375,43 @@ struct fuse_conn {
375 */ 375 */
376 376
377 /** Is fsync not implemented by fs? */ 377 /** Is fsync not implemented by fs? */
378 unsigned no_fsync : 1; 378 unsigned no_fsync:1;
379 379
380 /** Is fsyncdir not implemented by fs? */ 380 /** Is fsyncdir not implemented by fs? */
381 unsigned no_fsyncdir : 1; 381 unsigned no_fsyncdir:1;
382 382
383 /** Is flush not implemented by fs? */ 383 /** Is flush not implemented by fs? */
384 unsigned no_flush : 1; 384 unsigned no_flush:1;
385 385
386 /** Is setxattr not implemented by fs? */ 386 /** Is setxattr not implemented by fs? */
387 unsigned no_setxattr : 1; 387 unsigned no_setxattr:1;
388 388
389 /** Is getxattr not implemented by fs? */ 389 /** Is getxattr not implemented by fs? */
390 unsigned no_getxattr : 1; 390 unsigned no_getxattr:1;
391 391
392 /** Is listxattr not implemented by fs? */ 392 /** Is listxattr not implemented by fs? */
393 unsigned no_listxattr : 1; 393 unsigned no_listxattr:1;
394 394
395 /** Is removexattr not implemented by fs? */ 395 /** Is removexattr not implemented by fs? */
396 unsigned no_removexattr : 1; 396 unsigned no_removexattr:1;
397 397
398 /** Are file locking primitives not implemented by fs? */ 398 /** Are file locking primitives not implemented by fs? */
399 unsigned no_lock : 1; 399 unsigned no_lock:1;
400 400
401 /** Is access not implemented by fs? */ 401 /** Is access not implemented by fs? */
402 unsigned no_access : 1; 402 unsigned no_access:1;
403 403
404 /** Is create not implemented by fs? */ 404 /** Is create not implemented by fs? */
405 unsigned no_create : 1; 405 unsigned no_create:1;
406 406
407 /** Is interrupt not implemented by fs? */ 407 /** Is interrupt not implemented by fs? */
408 unsigned no_interrupt : 1; 408 unsigned no_interrupt:1;
409 409
410 /** Is bmap not implemented by fs? */ 410 /** Is bmap not implemented by fs? */
411 unsigned no_bmap : 1; 411 unsigned no_bmap:1;
412 412
413 /** Do multi-page cached writes */ 413 /** Do multi-page cached writes */
414 unsigned big_writes : 1; 414 unsigned big_writes:1;
415 415
416 /** The number of requests waiting for completion */ 416 /** The number of requests waiting for completion */
417 atomic_t num_waiting; 417 atomic_t num_waiting;
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 2e99f34b4435..739595b4196f 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1,6 +1,6 @@
1/* 1/*
2 FUSE: Filesystem in Userspace 2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> 3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
4 4
5 This program can be distributed under the terms of the GNU GPL. 5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING. 6 See the file COPYING.
@@ -37,10 +37,10 @@ struct fuse_mount_data {
37 unsigned rootmode; 37 unsigned rootmode;
38 unsigned user_id; 38 unsigned user_id;
39 unsigned group_id; 39 unsigned group_id;
40 unsigned fd_present : 1; 40 unsigned fd_present:1;
41 unsigned rootmode_present : 1; 41 unsigned rootmode_present:1;
42 unsigned user_id_present : 1; 42 unsigned user_id_present:1;
43 unsigned group_id_present : 1; 43 unsigned group_id_present:1;
44 unsigned flags; 44 unsigned flags;
45 unsigned max_read; 45 unsigned max_read;
46 unsigned blksize; 46 unsigned blksize;
@@ -250,7 +250,7 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
250 250
251 fi = get_fuse_inode(inode); 251 fi = get_fuse_inode(inode);
252 spin_lock(&fc->lock); 252 spin_lock(&fc->lock);
253 fi->nlookup ++; 253 fi->nlookup++;
254 spin_unlock(&fc->lock); 254 spin_unlock(&fc->lock);
255 fuse_change_attributes(inode, attr, attr_valid, attr_version); 255 fuse_change_attributes(inode, attr, attr_valid, attr_version);
256 256
@@ -553,8 +553,7 @@ static struct inode *get_root_inode(struct super_block *sb, unsigned mode)
553 return fuse_iget(sb, 1, 0, &attr, 0, 0); 553 return fuse_iget(sb, 1, 0, &attr, 0, 0);
554} 554}
555 555
556struct fuse_inode_handle 556struct fuse_inode_handle {
557{
558 u64 nodeid; 557 u64 nodeid;
559 u32 generation; 558 u32 generation;
560}; 559};
@@ -952,7 +951,7 @@ static inline void unregister_fuseblk(void)
952 951
953static void fuse_inode_init_once(void *foo) 952static void fuse_inode_init_once(void *foo)
954{ 953{
955 struct inode * inode = foo; 954 struct inode *inode = foo;
956 955
957 inode_init_once(inode); 956 inode_init_once(inode);
958} 957}
@@ -1031,7 +1030,7 @@ static int __init fuse_init(void)
1031{ 1030{
1032 int res; 1031 int res;
1033 1032
1034 printk("fuse init (API version %i.%i)\n", 1033 printk(KERN_INFO "fuse init (API version %i.%i)\n",
1035 FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION); 1034 FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);
1036 1035
1037 INIT_LIST_HEAD(&fuse_conn_list); 1036 INIT_LIST_HEAD(&fuse_conn_list);