diff options
Diffstat (limited to 'drivers/staging/pohmelfs')
-rw-r--r-- | drivers/staging/pohmelfs/crypto.c | 3 | ||||
-rw-r--r-- | drivers/staging/pohmelfs/dir.c | 9 | ||||
-rw-r--r-- | drivers/staging/pohmelfs/inode.c | 15 | ||||
-rw-r--r-- | drivers/staging/pohmelfs/net.c | 7 | ||||
-rw-r--r-- | drivers/staging/pohmelfs/netfs.h | 65 | ||||
-rw-r--r-- | drivers/staging/pohmelfs/trans.c | 7 |
6 files changed, 41 insertions, 65 deletions
diff --git a/drivers/staging/pohmelfs/crypto.c b/drivers/staging/pohmelfs/crypto.c index 31d765de92ce..19781ad782fb 100644 --- a/drivers/staging/pohmelfs/crypto.c +++ b/drivers/staging/pohmelfs/crypto.c @@ -832,8 +832,7 @@ int pohmelfs_trans_crypt(struct netfs_trans *trans, struct pohmelfs_sb *psb) return pohmelfs_crypto_thread_get(psb, pohmelfs_trans_crypt_action, trans); } -struct pohmelfs_crypto_input_action_data -{ +struct pohmelfs_crypto_input_action_data { struct page *page; struct pohmelfs_crypto_engine *e; u64 iv; diff --git a/drivers/staging/pohmelfs/dir.c b/drivers/staging/pohmelfs/dir.c index b5799842fb84..4c58e22c1fbe 100644 --- a/drivers/staging/pohmelfs/dir.c +++ b/drivers/staging/pohmelfs/dir.c @@ -562,7 +562,7 @@ struct dentry *pohmelfs_lookup(struct inode *dir, struct dentry *dentry, struct if (!inode) { dprintk("%s: No inode for ino: %lu, name: '%s', hash: %x.\n", __func__, ino, str.name, str.hash); - //return NULL; + /* return NULL; */ return ERR_PTR(-EACCES); } } else { @@ -692,9 +692,9 @@ static int pohmelfs_remove_entry(struct inode *dir, struct dentry *dentry) n = pohmelfs_search_hash(parent, str.hash); if (n) { pohmelfs_fix_offset(parent, n); - if (test_bit(NETFS_INODE_REMOTE_SYNCED, &pi->state)) { + if (test_bit(NETFS_INODE_REMOTE_SYNCED, &pi->state)) pohmelfs_remove_child(pi, n); - } + pohmelfs_name_free(parent, n); err = 0; } @@ -1006,9 +1006,8 @@ static int pohmelfs_rename(struct inode *old_dir, struct dentry *old_dentry, pi = POHMELFS_I(inode); old_parent = POHMELFS_I(old_dir); - if (new_dir) { + if (new_dir) new_dir->i_sb->s_op->write_inode(new_dir, 0); - } old_hash = jhash(old_dentry->d_name.name, old_dentry->d_name.len, 0); str.hash = jhash(new_dentry->d_name.name, new_dentry->d_name.len, 0); diff --git a/drivers/staging/pohmelfs/inode.c b/drivers/staging/pohmelfs/inode.c index b2eaf9047266..7b605795b770 100644 --- a/drivers/staging/pohmelfs/inode.c +++ b/drivers/staging/pohmelfs/inode.c @@ -386,7 +386,7 @@ static int pohmelfs_write_inode_create_children(struct inode *inode) if (inode && (inode->i_state & I_DIRTY)) { struct pohmelfs_inode *pi = POHMELFS_I(inode); pohmelfs_write_create_inode(pi); - //pohmelfs_meta_command(pi, NETFS_INODE_INFO, 0, NULL, NULL, 0); + /* pohmelfs_meta_command(pi, NETFS_INODE_INFO, 0, NULL, NULL, 0); */ iput(inode); } } @@ -845,7 +845,7 @@ static void pohmelfs_destroy_inode(struct inode *inode) struct pohmelfs_sb *psb = POHMELFS_SB(sb); struct pohmelfs_inode *pi = POHMELFS_I(inode); - //pohmelfs_data_unlock(pi, 0, inode->i_size, POHMELFS_READ_LOCK); + /* pohmelfs_data_unlock(pi, 0, inode->i_size, POHMELFS_READ_LOCK); */ pohmelfs_inode_del_inode(psb, pi); @@ -943,7 +943,7 @@ err_out_unlock: return ret; } -const static struct file_operations pohmelfs_file_ops = { +static const struct file_operations pohmelfs_file_ops = { .open = generic_file_open, .fsync = pohmelfs_fsync, @@ -1529,9 +1529,9 @@ static void pohmelfs_drop_scan(struct work_struct *work) struct pohmelfs_inode *pi; unsigned int count = 0; - while ((pi = pohmelfs_get_inode_from_list(psb, &psb->drop_list, &count))) { + while ((pi = pohmelfs_get_inode_from_list(psb, &psb->drop_list, &count))) pohmelfs_put_inode_count(pi, count); - } + pohmelfs_check_states(psb); if (psb->drop_scan_timeout) @@ -1568,9 +1568,8 @@ static void pohmelfs_trans_scan_state(struct netfs_state *st) rb_node = rb_next(rb_node); err = -ETIMEDOUT; - if (timeout && (++dst->retries < psb->trans_retries)) { + if (timeout && (++dst->retries < psb->trans_retries)) err = netfs_trans_resend(t, psb); - } if (err || (t->flags & NETFS_TRANS_SINGLE_DST)) { if (netfs_trans_remove_nolock(dst, st)) @@ -1777,7 +1776,7 @@ static int pohmelfs_show_stats(struct seq_file *m, struct vfsmount *mnt) seq_printf(m, "%u ", ctl->idx); if (ctl->addr.sa_family == AF_INET) { struct sockaddr_in *sin = (struct sockaddr_in *)&st->ctl.addr; - //seq_printf(m, "%pi4:%u", &sin->sin_addr.s_addr, ntohs(sin->sin_port)); + /* seq_printf(m, "%pi4:%u", &sin->sin_addr.s_addr, ntohs(sin->sin_port)); */ seq_printf(m, "%u.%u.%u.%u:%u", NIPQUAD(sin->sin_addr.s_addr), ntohs(sin->sin_port)); } else if (ctl->addr.sa_family == AF_INET6) { struct sockaddr_in6 *sin = (struct sockaddr_in6 *)&st->ctl.addr; diff --git a/drivers/staging/pohmelfs/net.c b/drivers/staging/pohmelfs/net.c index 11ecac026ca7..5f312c91aab6 100644 --- a/drivers/staging/pohmelfs/net.c +++ b/drivers/staging/pohmelfs/net.c @@ -168,8 +168,7 @@ int pohmelfs_data_recv_and_check(struct netfs_state *st, void *data, unsigned in * Polling machinery. */ -struct netfs_poll_helper -{ +struct netfs_poll_helper { poll_table pt; struct netfs_state *st; }; @@ -915,9 +914,9 @@ static int pohmelfs_recv(void *data) unsigned char *hash = e->data; dprintk("%s: received hash: ", __func__); - for (i=0; i<cmd->csize; ++i) { + for (i=0; i<cmd->csize; ++i) printk("%02x ", hash[i]); - } + printk("\n"); } #endif diff --git a/drivers/staging/pohmelfs/netfs.h b/drivers/staging/pohmelfs/netfs.h index c78cfcb042fb..3b60c611ba80 100644 --- a/drivers/staging/pohmelfs/netfs.h +++ b/drivers/staging/pohmelfs/netfs.h @@ -30,8 +30,7 @@ * Network command structure. * Will be extended. */ -struct netfs_cmd -{ +struct netfs_cmd { __u16 cmd; /* Command number */ __u16 csize; /* Attached crypto information size */ __u16 cpad; /* Attached padding size */ @@ -96,8 +95,7 @@ enum { */ #define _K_SS_MAXSIZE 128 -struct saddr -{ +struct saddr { unsigned short sa_family; char addr[_K_SS_MAXSIZE]; }; @@ -107,8 +105,7 @@ enum { POHMELFS_CRYPTO_CIPHER, }; -struct pohmelfs_crypto -{ +struct pohmelfs_crypto { unsigned int idx; /* Config index */ unsigned short strlen; /* Size of the attached crypto string including 0-byte * "cbc(aes)" for example */ @@ -123,8 +120,7 @@ struct pohmelfs_crypto /* * Configuration command used to create table of different remote servers. */ -struct pohmelfs_ctl -{ +struct pohmelfs_ctl { __u32 idx; /* Config index */ __u32 type; /* Socket type */ __u32 proto; /* Socket protocol */ @@ -137,8 +133,7 @@ struct pohmelfs_ctl /* * Ack for userspace about requested command. */ -struct pohmelfs_cn_ack -{ +struct pohmelfs_cn_ack { struct cn_msg msg; int error; int msg_num; @@ -150,8 +145,7 @@ struct pohmelfs_cn_ack * Inode info structure used to sync with server. * Check what stat() returns. */ -struct netfs_inode_info -{ +struct netfs_inode_info { unsigned int mode; unsigned int nlink; unsigned int uid; @@ -205,8 +199,7 @@ enum pohmelfs_capabilities { /* Extended attributes support on/off */ #define POHMELFS_FLAGS_XATTR (1<<1) -struct netfs_root_capabilities -{ +struct netfs_root_capabilities { __u64 nr_files; __u64 used, avail; __u64 flags; @@ -220,8 +213,7 @@ static inline void netfs_convert_root_capabilities(struct netfs_root_capabilitie cap->flags = __cpu_to_be64(cap->flags); } -struct netfs_crypto_capabilities -{ +struct netfs_crypto_capabilities { unsigned short hash_strlen; /* Hash string length, like "hmac(sha1) including 0 byte "*/ unsigned short cipher_strlen; /* Cipher string length with the same format */ unsigned int cipher_keysize; /* Cipher key size */ @@ -241,8 +233,7 @@ enum pohmelfs_lock_type { POHMELFS_WRITE_LOCK, }; -struct netfs_lock -{ +struct netfs_lock { __u64 start; __u64 ino; __u32 size; @@ -268,8 +259,7 @@ static inline void netfs_convert_lock(struct netfs_lock *lock) /* * Private POHMELFS cache of objects in directory. */ -struct pohmelfs_name -{ +struct pohmelfs_name { struct rb_node hash_node; struct list_head sync_create_entry; @@ -286,8 +276,7 @@ struct pohmelfs_name /* * POHMELFS inode. Main object. */ -struct pohmelfs_inode -{ +struct pohmelfs_inode { struct list_head inode_entry; /* Entry in superblock list. * Objects which are not bound to dentry require to be dropped * in ->put_super() @@ -318,8 +307,7 @@ typedef int (* netfs_trans_complete_t)(struct page **pages, unsigned int page_nu struct netfs_state; struct pohmelfs_sb; -struct netfs_trans -{ +struct netfs_trans { /* * Transaction header and attached contiguous data live here. */ @@ -426,8 +414,7 @@ static inline void netfs_trans_reset(struct netfs_trans *t) t->complete = NULL; } -struct netfs_trans_dst -{ +struct netfs_trans_dst { struct list_head trans_entry; struct rb_node state_entry; @@ -456,8 +443,7 @@ int netfs_trans_remove_nolock(struct netfs_trans_dst *dst, struct netfs_state *s int netfs_trans_init(void); void netfs_trans_exit(void); -struct pohmelfs_crypto_engine -{ +struct pohmelfs_crypto_engine { u64 iv; /* Crypto IV for current operation */ unsigned long timeout; /* Crypto waiting timeout */ unsigned int size; /* Size of crypto scratchpad */ @@ -474,8 +460,7 @@ struct pohmelfs_crypto_engine unsigned int page_num; }; -struct pohmelfs_crypto_thread -{ +struct pohmelfs_crypto_thread { struct list_head thread_entry; struct task_struct *thread; @@ -497,8 +482,7 @@ void pohmelfs_crypto_thread_make_ready(struct pohmelfs_crypto_thread *th); /* * Network state, attached to one server. */ -struct netfs_state -{ +struct netfs_state { struct mutex __state_lock; /* Can not allow to use the same socket simultaneously */ struct mutex __state_send_lock; struct netfs_cmd cmd; /* Cached command */ @@ -580,8 +564,7 @@ static inline unsigned int netfs_state_poll(struct netfs_state *st) struct pohmelfs_config; -struct pohmelfs_sb -{ +struct pohmelfs_sb { struct rb_root mcache_root; struct mutex mcache_lock; atomic_long_t mcache_gen; @@ -718,15 +701,13 @@ static inline void pohmelfs_put_inode(struct pohmelfs_inode *pi) spin_unlock(&psb->ino_lock); } -struct pohmelfs_config -{ +struct pohmelfs_config { struct list_head config_entry; struct netfs_state state; }; -struct pohmelfs_config_group -{ +struct pohmelfs_config_group { /* * Entry in the global config group list. */ @@ -814,8 +795,7 @@ void pohmelfs_switch_active(struct pohmelfs_sb *psb); int pohmelfs_construct_path_string(struct pohmelfs_inode *pi, void *data, int len); int pohmelfs_path_length(struct pohmelfs_inode *pi); -struct pohmelfs_crypto_completion -{ +struct pohmelfs_crypto_completion { struct completion complete; int error; }; @@ -864,7 +844,7 @@ static inline int pohmelfs_need_lock(struct pohmelfs_inode *pi, int type) int __init pohmelfs_mcache_init(void); void pohmelfs_mcache_exit(void); -//#define CONFIG_POHMELFS_DEBUG +/* #define CONFIG_POHMELFS_DEBUG */ #ifdef CONFIG_POHMELFS_DEBUG #define dprintka(f, a...) printk(f, ##a) @@ -891,8 +871,7 @@ static inline void netfs_trans_put(struct netfs_trans *t) } } -struct pohmelfs_mcache -{ +struct pohmelfs_mcache { struct rb_node mcache_entry; struct completion complete; diff --git a/drivers/staging/pohmelfs/trans.c b/drivers/staging/pohmelfs/trans.c index fef5f9bd6920..4587f6d546aa 100644 --- a/drivers/staging/pohmelfs/trans.c +++ b/drivers/staging/pohmelfs/trans.c @@ -101,7 +101,8 @@ static int netfs_trans_send_pages(struct netfs_trans *t, struct netfs_state *st) goto err_out; } - msg.msg_flags = MSG_WAITALL|(attached_pages == 1)?0:MSG_MORE; + msg.msg_flags = MSG_WAITALL | (attached_pages == 1 ? 0 : + MSG_MORE); err = kernel_sendpage(st->socket, page, 0, size, msg.msg_flags); if (err <= 0) { @@ -177,9 +178,9 @@ int netfs_trans_send(struct netfs_trans *t, struct netfs_state *st) err_out_unlock_return: - if (st->need_reset) { + if (st->need_reset) netfs_state_exit(st); - } + netfs_state_unlock_send(st); dprintk("%s: t: %p, gen: %u, err: %d.\n", |