diff options
author | Latchesar Ionkov <lucho@ionkov.net> | 2005-09-23 00:43:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-23 01:17:33 -0400 |
commit | a8e63bff521f0387fb4f4e486dede0e78dca8f41 (patch) | |
tree | 8267e3f5e8a5eb3d6fe92659def6f5bee1190b03 /fs/9p | |
parent | 5b067676234715051cbde87083c36c8ea83f77b8 (diff) |
[PATCH] v9fs: make copy of the transport prototype instead of using it directly
When a new session is created it uses a template object of the specified
transport type to instantiate its own copy. The code for the making a copy of
the template object was lost, and the object itself is attached to the v9fs
session. This leads to many sessions using the same transport instead of
having their own copy.
The patch puts back the code that makes a copy of the template object.
Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/v9fs.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index 13bdbbab4387..82303f3bf76f 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c | |||
@@ -303,7 +303,13 @@ v9fs_session_init(struct v9fs_session_info *v9ses, | |||
303 | goto SessCleanUp; | 303 | goto SessCleanUp; |
304 | }; | 304 | }; |
305 | 305 | ||
306 | v9ses->transport = trans_proto; | 306 | v9ses->transport = kmalloc(sizeof(*v9ses->transport), GFP_KERNEL); |
307 | if (!v9ses->transport) { | ||
308 | retval = -ENOMEM; | ||
309 | goto SessCleanUp; | ||
310 | } | ||
311 | |||
312 | memmove(v9ses->transport, trans_proto, sizeof(*v9ses->transport)); | ||
307 | 313 | ||
308 | if ((retval = v9ses->transport->init(v9ses, dev_name, data)) < 0) { | 314 | if ((retval = v9ses->transport->init(v9ses, dev_name, data)) < 0) { |
309 | eprintk(KERN_ERR, "problem initializing transport\n"); | 315 | eprintk(KERN_ERR, "problem initializing transport\n"); |