aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/pohmelfs/inode.c4
-rw-r--r--drivers/staging/pohmelfs/net.c56
-rw-r--r--drivers/staging/pohmelfs/netfs.h6
-rw-r--r--drivers/staging/pohmelfs/trans.c2
4 files changed, 2 insertions, 66 deletions
diff --git a/drivers/staging/pohmelfs/inode.c b/drivers/staging/pohmelfs/inode.c
index af99f6620b7e..a12fcc6c72b5 100644
--- a/drivers/staging/pohmelfs/inode.c
+++ b/drivers/staging/pohmelfs/inode.c
@@ -1343,8 +1343,6 @@ static void pohmelfs_put_super(struct super_block *sb)
1343 1343
1344 kfree(psb); 1344 kfree(psb);
1345 sb->s_fs_info = NULL; 1345 sb->s_fs_info = NULL;
1346
1347 pohmelfs_ftrans_exit();
1348} 1346}
1349 1347
1350static int pohmelfs_statfs(struct dentry *dentry, struct kstatfs *buf) 1348static int pohmelfs_statfs(struct dentry *dentry, struct kstatfs *buf)
@@ -1783,8 +1781,6 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
1783 struct pohmelfs_inode *npi; 1781 struct pohmelfs_inode *npi;
1784 struct qstr str; 1782 struct qstr str;
1785 1783
1786 pohmelfs_ftrans_init();
1787
1788 psb = kzalloc(sizeof(struct pohmelfs_sb), GFP_KERNEL); 1784 psb = kzalloc(sizeof(struct pohmelfs_sb), GFP_KERNEL);
1789 if (!psb) 1785 if (!psb)
1790 goto err_out_exit; 1786 goto err_out_exit;
diff --git a/drivers/staging/pohmelfs/net.c b/drivers/staging/pohmelfs/net.c
index 93a5921c36f4..11ecac026ca7 100644
--- a/drivers/staging/pohmelfs/net.c
+++ b/drivers/staging/pohmelfs/net.c
@@ -26,55 +26,6 @@
26 26
27#include "netfs.h" 27#include "netfs.h"
28 28
29static int pohmelfs_ftrans_size = 10240;
30static u32 *pohmelfs_ftrans;
31
32int pohmelfs_ftrans_init(void)
33{
34 pohmelfs_ftrans = vmalloc(pohmelfs_ftrans_size * 4);
35 if (!pohmelfs_ftrans)
36 return -ENOMEM;
37
38 return 0;
39}
40
41void pohmelfs_ftrans_exit(void)
42{
43 vfree(pohmelfs_ftrans);
44}
45
46void pohmelfs_ftrans_clean(u64 id)
47{
48 if (pohmelfs_ftrans) {
49 u32 i = id & 0xffffffff;
50 int idx = i % pohmelfs_ftrans_size;
51
52 pohmelfs_ftrans[idx] = 0;
53 }
54}
55
56void pohmelfs_ftrans_update(u64 id)
57{
58 if (pohmelfs_ftrans) {
59 u32 i = id & 0xffffffff;
60 int idx = i % pohmelfs_ftrans_size;
61
62 pohmelfs_ftrans[idx] = i;
63 }
64}
65
66int pohmelfs_ftrans_check(u64 id)
67{
68 if (pohmelfs_ftrans) {
69 u32 i = id & 0xffffffff;
70 int idx = i % pohmelfs_ftrans_size;
71
72 return (pohmelfs_ftrans[idx] == i);
73 }
74
75 return -1;
76}
77
78/* 29/*
79 * Async machinery lives here. 30 * Async machinery lives here.
80 * All commands being sent to server do _not_ require sync reply, 31 * All commands being sent to server do _not_ require sync reply,
@@ -654,15 +605,12 @@ static int pohmelfs_transaction_response(struct netfs_state *st)
654 if (dst) { 605 if (dst) {
655 netfs_trans_remove_nolock(dst, st); 606 netfs_trans_remove_nolock(dst, st);
656 t = dst->trans; 607 t = dst->trans;
657
658 pohmelfs_ftrans_update(cmd->start);
659 } 608 }
660 mutex_unlock(&st->trans_lock); 609 mutex_unlock(&st->trans_lock);
661 610
662 if (!t) { 611 if (!t) {
663 int check = pohmelfs_ftrans_check(cmd->start); 612 printk("%s: failed to find transaction: start: %llu: id: %llu, size: %u, ext: %u.\n",
664 printk("%s: failed to find transaction: start: %llu: id: %llu, size: %u, ext: %u, double: %d.\n", 613 __func__, cmd->start, cmd->id, cmd->size, cmd->ext);
665 __func__, cmd->start, cmd->id, cmd->size, cmd->ext, check);
666 err = -EINVAL; 614 err = -EINVAL;
667 goto out; 615 goto out;
668 } 616 }
diff --git a/drivers/staging/pohmelfs/netfs.h b/drivers/staging/pohmelfs/netfs.h
index 2ff21ae5bb12..59f81cbf388c 100644
--- a/drivers/staging/pohmelfs/netfs.h
+++ b/drivers/staging/pohmelfs/netfs.h
@@ -921,12 +921,6 @@ static inline void pohmelfs_mcache_put(struct pohmelfs_sb *psb,
921 pohmelfs_mcache_free(psb, m); 921 pohmelfs_mcache_free(psb, m);
922} 922}
923 923
924int pohmelfs_ftrans_init(void);
925void pohmelfs_ftrans_exit(void);
926void pohmelfs_ftrans_update(u64 id);
927int pohmelfs_ftrans_check(u64 id);
928void pohmelfs_ftrans_clean(u64 id);
929
930#endif /* __KERNEL__*/ 924#endif /* __KERNEL__*/
931 925
932#endif /* __NETFS_H */ 926#endif /* __NETFS_H */
diff --git a/drivers/staging/pohmelfs/trans.c b/drivers/staging/pohmelfs/trans.c
index bcb59425a21c..b89f9f36b350 100644
--- a/drivers/staging/pohmelfs/trans.c
+++ b/drivers/staging/pohmelfs/trans.c
@@ -501,8 +501,6 @@ int netfs_trans_finish(struct netfs_trans *t, struct pohmelfs_sb *psb)
501 501
502 t->gen = atomic_inc_return(&psb->trans_gen); 502 t->gen = atomic_inc_return(&psb->trans_gen);
503 503
504 pohmelfs_ftrans_clean(t->gen);
505
506 cmd->size = t->iovec.iov_len - sizeof(struct netfs_cmd) + 504 cmd->size = t->iovec.iov_len - sizeof(struct netfs_cmd) +
507 t->attached_size + t->attached_pages * sizeof(struct netfs_cmd); 505 t->attached_size + t->attached_pages * sizeof(struct netfs_cmd);
508 cmd->cmd = NETFS_TRANS; 506 cmd->cmd = NETFS_TRANS;