aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/conv.c
diff options
context:
space:
mode:
authorLatchesar Ionkov <lucho@ionkov.net>2006-03-25 06:07:26 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 11:22:54 -0500
commit16cce6d27ef52e00cc124196046bbae7150024c1 (patch)
treed4494a6a5146fa7314138f674c2928e31c26bcc0 /fs/9p/conv.c
parent5174fdab9f58181249debab6e959ae4fd4abd0ed (diff)
[PATCH] v9fs: add extension field to Tcreate
Implement a new way of creating special files. Instead of Tcreate+Twstat, add one more field to Tcreate that contains special file description. Signed-off-by: Latchesar Ionkov <lucho@ionkov.net> Signed-off-by: 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/conv.c')
-rw-r--r--fs/9p/conv.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/9p/conv.c b/fs/9p/conv.c
index bba817142465..b129079e5f32 100644
--- a/fs/9p/conv.c
+++ b/fs/9p/conv.c
@@ -666,7 +666,8 @@ struct v9fs_fcall *v9fs_create_topen(u32 fid, u8 mode)
666 return fc; 666 return fc;
667} 667}
668 668
669struct v9fs_fcall *v9fs_create_tcreate(u32 fid, char *name, u32 perm, u8 mode) 669struct v9fs_fcall *v9fs_create_tcreate(u32 fid, char *name, u32 perm, u8 mode,
670 char *extension, int extended)
670{ 671{
671 int size; 672 int size;
672 struct v9fs_fcall *fc; 673 struct v9fs_fcall *fc;
@@ -674,6 +675,9 @@ struct v9fs_fcall *v9fs_create_tcreate(u32 fid, char *name, u32 perm, u8 mode)
674 struct cbuf *bufp = &buffer; 675 struct cbuf *bufp = &buffer;
675 676
676 size = 4 + 2 + strlen(name) + 4 + 1; /* fid[4] name[s] perm[4] mode[1] */ 677 size = 4 + 2 + strlen(name) + 4 + 1; /* fid[4] name[s] perm[4] mode[1] */
678 if (extended && extension!=NULL)
679 size += 2 + strlen(extension); /* extension[s] */
680
677 fc = v9fs_create_common(bufp, size, TCREATE); 681 fc = v9fs_create_common(bufp, size, TCREATE);
678 if (IS_ERR(fc)) 682 if (IS_ERR(fc))
679 goto error; 683 goto error;
@@ -682,6 +686,8 @@ struct v9fs_fcall *v9fs_create_tcreate(u32 fid, char *name, u32 perm, u8 mode)
682 v9fs_put_str(bufp, name, &fc->params.tcreate.name); 686 v9fs_put_str(bufp, name, &fc->params.tcreate.name);
683 v9fs_put_int32(bufp, perm, &fc->params.tcreate.perm); 687 v9fs_put_int32(bufp, perm, &fc->params.tcreate.perm);
684 v9fs_put_int8(bufp, mode, &fc->params.tcreate.mode); 688 v9fs_put_int8(bufp, mode, &fc->params.tcreate.mode);
689 if (extended)
690 v9fs_put_str(bufp, extension, &fc->params.tcreate.extension);
685 691
686 if (buf_check_overflow(bufp)) { 692 if (buf_check_overflow(bufp)) {
687 kfree(fc); 693 kfree(fc);