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>
This commit is contained in:
Miklos Szeredi 2008-11-26 12:03:54 +01:00 committed by Miklos Szeredi
parent ed313489ba
commit 1729a16c2c
6 changed files with 54 additions and 47 deletions

View file

@ -1,6 +1,6 @@
/* /*
FUSE: Filesystem in Userspace FUSE: Filesystem in Userspace
Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU GPL. This program can be distributed under the terms of the GNU GPL.
See the file COPYING. See the file COPYING.
@ -48,11 +48,13 @@ static ssize_t fuse_conn_waiting_read(struct file *file, char __user *buf,
size_t size; size_t size;
if (!*ppos) { if (!*ppos) {
long value;
struct fuse_conn *fc = fuse_ctl_file_conn_get(file); struct fuse_conn *fc = fuse_ctl_file_conn_get(file);
if (!fc) if (!fc)
return 0; return 0;
file->private_data=(void *)(long)atomic_read(&fc->num_waiting); value = atomic_read(&fc->num_waiting);
file->private_data = (void *)value;
fuse_conn_put(fc); fuse_conn_put(fc);
} }
size = sprintf(tmp, "%ld\n", (long)file->private_data); size = sprintf(tmp, "%ld\n", (long)file->private_data);

View file

@ -1,6 +1,6 @@
/* /*
FUSE: Filesystem in Userspace FUSE: Filesystem in Userspace
Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU GPL. This program can be distributed under the terms of the GNU GPL.
See the file COPYING. See the file COPYING.
@ -539,8 +539,8 @@ static int fuse_copy_fill(struct fuse_copy_state *cs)
BUG_ON(!cs->nr_segs); BUG_ON(!cs->nr_segs);
cs->seglen = cs->iov[0].iov_len; cs->seglen = cs->iov[0].iov_len;
cs->addr = (unsigned long) cs->iov[0].iov_base; cs->addr = (unsigned long) cs->iov[0].iov_base;
cs->iov ++; cs->iov++;
cs->nr_segs --; cs->nr_segs--;
} }
down_read(&current->mm->mmap_sem); down_read(&current->mm->mmap_sem);
err = get_user_pages(current, current->mm, cs->addr, 1, cs->write, 0, 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,
kunmap_atomic(mapaddr, KM_USER1); kunmap_atomic(mapaddr, KM_USER1);
} }
while (count) { while (count) {
int err; if (!cs->len) {
if (!cs->len && (err = fuse_copy_fill(cs))) int err = fuse_copy_fill(cs);
return err; if (err)
return err;
}
if (page) { if (page) {
void *mapaddr = kmap_atomic(page, KM_USER1); void *mapaddr = kmap_atomic(page, KM_USER1);
void *buf = mapaddr + offset; void *buf = mapaddr + offset;
@ -631,9 +633,11 @@ static int fuse_copy_pages(struct fuse_copy_state *cs, unsigned nbytes,
static int fuse_copy_one(struct fuse_copy_state *cs, void *val, unsigned size) static int fuse_copy_one(struct fuse_copy_state *cs, void *val, unsigned size)
{ {
while (size) { while (size) {
int err; if (!cs->len) {
if (!cs->len && (err = fuse_copy_fill(cs))) int err = fuse_copy_fill(cs);
return err; if (err)
return err;
}
fuse_copy_do(cs, &val, &size); fuse_copy_do(cs, &val, &size);
} }
return 0; return 0;

View file

@ -1,6 +1,6 @@
/* /*
FUSE: Filesystem in Userspace FUSE: Filesystem in Userspace
Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU GPL. This program can be distributed under the terms of the GNU GPL.
See the file COPYING. See the file COPYING.
@ -204,7 +204,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
return 0; return 0;
} }
spin_lock(&fc->lock); spin_lock(&fc->lock);
fi->nlookup ++; fi->nlookup++;
spin_unlock(&fc->lock); spin_unlock(&fc->lock);
} }
fuse_put_request(fc, forget_req); fuse_put_request(fc, forget_req);
@ -637,9 +637,11 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry)
if (!err) { if (!err) {
struct inode *inode = entry->d_inode; struct inode *inode = entry->d_inode;
/* Set nlink to zero so the inode can be cleared, if /*
the inode does have more links this will be * Set nlink to zero so the inode can be cleared, if the inode
discovered at the next lookup/getattr */ * does have more links this will be discovered at the next
* lookup/getattr.
*/
clear_nlink(inode); clear_nlink(inode);
fuse_invalidate_attr(inode); fuse_invalidate_attr(inode);
fuse_invalidate_attr(dir); fuse_invalidate_attr(dir);

View file

@ -1,6 +1,6 @@
/* /*
FUSE: Filesystem in Userspace FUSE: Filesystem in Userspace
Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU GPL. This program can be distributed under the terms of the GNU GPL.
See the file COPYING. See the file COPYING.
@ -543,7 +543,7 @@ static int fuse_readpages_fill(void *_data, struct page *page)
} }
} }
req->pages[req->num_pages] = page; req->pages[req->num_pages] = page;
req->num_pages ++; req->num_pages++;
return 0; return 0;
} }

View file

@ -1,6 +1,6 @@
/* /*
FUSE: Filesystem in Userspace FUSE: Filesystem in Userspace
Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU GPL. This program can be distributed under the terms of the GNU GPL.
See the file COPYING. See the file COPYING.
@ -355,19 +355,19 @@ struct fuse_conn {
/** Connection failed (version mismatch). Cannot race with /** Connection failed (version mismatch). Cannot race with
setting other bitfields since it is only set once in INIT setting other bitfields since it is only set once in INIT
reply, before any other request, and never cleared */ reply, before any other request, and never cleared */
unsigned conn_error : 1; unsigned conn_error:1;
/** Connection successful. Only set in INIT */ /** Connection successful. Only set in INIT */
unsigned conn_init : 1; unsigned conn_init:1;
/** Do readpages asynchronously? Only set in INIT */ /** Do readpages asynchronously? Only set in INIT */
unsigned async_read : 1; unsigned async_read:1;
/** Do not send separate SETATTR request before open(O_TRUNC) */ /** Do not send separate SETATTR request before open(O_TRUNC) */
unsigned atomic_o_trunc : 1; unsigned atomic_o_trunc:1;
/** Filesystem supports NFS exporting. Only set in INIT */ /** Filesystem supports NFS exporting. Only set in INIT */
unsigned export_support : 1; unsigned export_support:1;
/* /*
* The following bitfields are only for optimization purposes * The following bitfields are only for optimization purposes
@ -375,43 +375,43 @@ struct fuse_conn {
*/ */
/** Is fsync not implemented by fs? */ /** Is fsync not implemented by fs? */
unsigned no_fsync : 1; unsigned no_fsync:1;
/** Is fsyncdir not implemented by fs? */ /** Is fsyncdir not implemented by fs? */
unsigned no_fsyncdir : 1; unsigned no_fsyncdir:1;
/** Is flush not implemented by fs? */ /** Is flush not implemented by fs? */
unsigned no_flush : 1; unsigned no_flush:1;
/** Is setxattr not implemented by fs? */ /** Is setxattr not implemented by fs? */
unsigned no_setxattr : 1; unsigned no_setxattr:1;
/** Is getxattr not implemented by fs? */ /** Is getxattr not implemented by fs? */
unsigned no_getxattr : 1; unsigned no_getxattr:1;
/** Is listxattr not implemented by fs? */ /** Is listxattr not implemented by fs? */
unsigned no_listxattr : 1; unsigned no_listxattr:1;
/** Is removexattr not implemented by fs? */ /** Is removexattr not implemented by fs? */
unsigned no_removexattr : 1; unsigned no_removexattr:1;
/** Are file locking primitives not implemented by fs? */ /** Are file locking primitives not implemented by fs? */
unsigned no_lock : 1; unsigned no_lock:1;
/** Is access not implemented by fs? */ /** Is access not implemented by fs? */
unsigned no_access : 1; unsigned no_access:1;
/** Is create not implemented by fs? */ /** Is create not implemented by fs? */
unsigned no_create : 1; unsigned no_create:1;
/** Is interrupt not implemented by fs? */ /** Is interrupt not implemented by fs? */
unsigned no_interrupt : 1; unsigned no_interrupt:1;
/** Is bmap not implemented by fs? */ /** Is bmap not implemented by fs? */
unsigned no_bmap : 1; unsigned no_bmap:1;
/** Do multi-page cached writes */ /** Do multi-page cached writes */
unsigned big_writes : 1; unsigned big_writes:1;
/** The number of requests waiting for completion */ /** The number of requests waiting for completion */
atomic_t num_waiting; atomic_t num_waiting;

View file

@ -1,6 +1,6 @@
/* /*
FUSE: Filesystem in Userspace FUSE: Filesystem in Userspace
Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU GPL. This program can be distributed under the terms of the GNU GPL.
See the file COPYING. See the file COPYING.
@ -37,10 +37,10 @@ struct fuse_mount_data {
unsigned rootmode; unsigned rootmode;
unsigned user_id; unsigned user_id;
unsigned group_id; unsigned group_id;
unsigned fd_present : 1; unsigned fd_present:1;
unsigned rootmode_present : 1; unsigned rootmode_present:1;
unsigned user_id_present : 1; unsigned user_id_present:1;
unsigned group_id_present : 1; unsigned group_id_present:1;
unsigned flags; unsigned flags;
unsigned max_read; unsigned max_read;
unsigned blksize; unsigned blksize;
@ -250,7 +250,7 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
fi = get_fuse_inode(inode); fi = get_fuse_inode(inode);
spin_lock(&fc->lock); spin_lock(&fc->lock);
fi->nlookup ++; fi->nlookup++;
spin_unlock(&fc->lock); spin_unlock(&fc->lock);
fuse_change_attributes(inode, attr, attr_valid, attr_version); fuse_change_attributes(inode, attr, attr_valid, attr_version);
@ -553,8 +553,7 @@ static struct inode *get_root_inode(struct super_block *sb, unsigned mode)
return fuse_iget(sb, 1, 0, &attr, 0, 0); return fuse_iget(sb, 1, 0, &attr, 0, 0);
} }
struct fuse_inode_handle struct fuse_inode_handle {
{
u64 nodeid; u64 nodeid;
u32 generation; u32 generation;
}; };
@ -952,7 +951,7 @@ static inline void unregister_fuseblk(void)
static void fuse_inode_init_once(void *foo) static void fuse_inode_init_once(void *foo)
{ {
struct inode * inode = foo; struct inode *inode = foo;
inode_init_once(inode); inode_init_once(inode);
} }
@ -1031,7 +1030,7 @@ static int __init fuse_init(void)
{ {
int res; int res;
printk("fuse init (API version %i.%i)\n", printk(KERN_INFO "fuse init (API version %i.%i)\n",
FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION); FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);
INIT_LIST_HEAD(&fuse_conn_list); INIT_LIST_HEAD(&fuse_conn_list);