Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
Small test. #include #include #include #include #include #include #include #include #include #include #include #include #include #include main (){ int amaster, aslave, master; char name[100] = "/dev/ptm"; struct termios termp; struct winsize winp; printf("Pty

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
On 04.04.2014 18:55, Christos Zoulas wrote: > On Apr 4, 6:40pm, net...@izyk.ru (Ilya Zykov) wrote: > -- Subject: Re: Enhance ptyfs to handle multiple instances. > > | > > | > Should we put a pointer in the pty node that points to the primary mount > point > | >

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
On 04.04.2014 18:55, Christos Zoulas wrote: > On Apr 4, 6:40pm, net...@izyk.ru (Ilya Zykov) wrote: > -- Subject: Re: Enhance ptyfs to handle multiple instances. > > | > > | > Should we put a pointer in the pty node that points to the primary mount > point > | >

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
On 04.04.2014 18:55, Christos Zoulas wrote: > On Apr 4, 6:40pm, net...@izyk.ru (Ilya Zykov) wrote: > -- Subject: Re: Enhance ptyfs to handle multiple instances. > > | > > | > Should we put a pointer in the pty node that points to the primary mount > point > | >

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
On 04.04.2014 18:40, Ilya Zykov wrote: >> >> Should we put a pointer in the pty node that points to the primary mount >> point >> then so we get the correct one? > > Why? In general case we forever must return first which mount first, next > mount point, &

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
> > Should we put a pointer in the pty node that points to the primary mount point > then so we get the correct one? Why? In general case we forever must return first which mount first, next mount point, shouldn't replace previous, else incorrect TIOCPTMGET(path) for already opened pty we will

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
Some misspelling corrections. fs/ptyfs/ptyfs.h|2 + fs/ptyfs/ptyfs_vfsops.c | 63 ++-- fs/ptyfs/ptyfs_vnops.c | 25 ++- kern/tty_bsdpty.c | 11 +++- kern/tty_ptm.c | 45 ---

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
> > - I don't like the refactoring because it makes ptyfs less optional (brings > in code and headers to the base kernel). I think it is simpler to provide > an entry function to get the mount point instead, and this way all the guts > of ptyfs stay in ptyfs. Looks better, thank you. > - I

Re: Enhance ptyfs to handle multiple instances.

2014-04-01 Thread Ilya Zykov
On 01.04.2014 23:38, Ilya Zykov wrote: > Hello! > > This patch introduces subject. > Some code refactoring, because we have more stronger ptm - ptyfs binding. > BSD pty compatibility improvement. > > Main explanation you can see in comments inside. > Also I am not su

Re: Enhance ptyfs to handle multiple instances.

2014-04-01 Thread Ilya Zykov
Hello! This patch introduces subject. Some code refactoring, because we have more stronger ptm - ptyfs binding. BSD pty compatibility improvement. Main explanation you can see in comments inside. Also I am not sure about, how, correctly release unused vnode and return it for system and call recla

Re: Enhance ptyfs to handle multiple instances.

2014-03-27 Thread Ilya Zykov
> | On 27.03.2014 12:51, Ilya Zykov wrote: > | > Hello! > | > Maybe you skipped: > | > Minor corrections readdir and lookup for multi-mountpoint use. > | > > | > ptyfs_vnops.c |6 -- > | > 1 file changed, 4 insertions(+), 2 deletions(-) Pleas

Re: Enhance ptyfs to handle multiple instances.

2014-03-27 Thread Ilya Zykov
On 27.03.2014 12:51, Ilya Zykov wrote: > Hello! > Maybe you skipped: > Minor corrections readdir and lookup for multi-mountpoint use. > > ptyfs_vnops.c |6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > Resending. > > Also main patch for subjec

Re: Enhance ptyfs to handle multiple instances.

2014-03-27 Thread Ilya Zykov
Hello! Maybe you skipped: Minor corrections readdir and lookup for multi-mountpoint use. ptyfs_vnops.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Resending. Also main patch for subject. I didn't want locate many code in ptm driver, but in real world, it was the most suitable

Re: Enhance ptyfs to handle multiple instances.

2014-03-26 Thread Ilya Zykov
PTYFS has dependency from ptm driver. If config has NO_DEV_PTM, PTYFS isn't compiled. PTYFS is useless without ptm. How, better, this condition is fixed in config files?

Re: Enhance ptyfs to handle multiple instances.

2014-03-26 Thread Ilya Zykov
> | > | - error = (*ptm->makename)(ptm, l, name, sizeof(name), dev, ms); > | + error = pty_makename(ptm, l, name, sizeof(name), dev, ms); > | if (error) > | return error; > | > > Are you sure about this one? It is used when ptyfs is mounted and you have > old pty nodes arou

Re: Enhance ptyfs to handle multiple instances.

2014-03-26 Thread Ilya Zykov
Some minor improvements. fs/ptyfs/ptyfs_subr.c |4 ++-- kern/tty_bsdpty.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Ilya. Index: fs/ptyfs/ptyfs_subr.c === RCS file: /cvsil/nbcur/src/sys/fs/ptyfs/ptyfs_subr

Re: Enhance ptyfs to handle multiple instances.

2014-03-26 Thread Ilya Zykov
Hello! Minor corrections readdir and lookup for multi-mountpoint use. ptyfs_vnops.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Ilya. Index: fs/ptyfs/ptyfs_vnops.c === RCS file: /cvsil/nbcur/src/sys/fs/ptyfs/pty

Re: Enhance ptyfs to handle multiple instances.

2014-03-24 Thread Ilya Zykov
> > You can't find from the driver where the device node file is located > OK, I thought so. Thank you.

Re: Enhance ptyfs to handle multiple instances.

2014-03-24 Thread Ilya Zykov
Hello! Please, tell me know if I wrong. In general case I can't find(easy), from driver, where its device file located on file system, its vnode or its directory vnode where this file located. Such files can be many and I can't find what file used for current operation. Maybe anybody had being at

Re: Enhance ptyfs to handle multiple instances.

2014-03-22 Thread Ilya Zykov
> The mountpoint inside ptm_pty. Perhaps by having separate instances in the ptm > driver? > > christos > > I think, it's not better. I can do so, but: 1. Now we have only 2 instances ptm_pty, one for ptyfs one for bsdpty and use its mainly for switch from one to other(we will have ptm_pty ar

Re: Enhance ptyfs to handle multiple instances.

2014-03-22 Thread Ilya Zykov
> > I don't understand why you want to get rid of the mountpoint arg inside > the pty structure. It certainly makes things faster, and the pty can't > be shared... > > christos > Sorry, but I don't understand too, what structure do you mean exactly and how. Ilya.

Re: Enhance ptyfs to handle multiple instances.

2014-03-21 Thread Ilya Zykov
DONE. :) If seriously, it's first working prototype for comments and objections. It's working as follow: Mount first ptyfs instance in /dev/pts(or other path) you can get access to master side through ptm{x} device. Mount second ptyfs instance inside chroot(Example: /var/chroot/test/dev/pts),

Re: Enhance ptyfs to handle multiple instances.

2014-03-21 Thread Ilya Zykov
Hello! Correct "ptyfs_readdir" for multi mount points use. ptyfs.h |1 + ptyfs_subr.c |3 +-- ptyfs_vnops.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Ilya. Index: fs/ptyfs/ptyfs.h === RCS file: /cv

Re: Enhance ptyfs to handle multiple instances.

2014-03-19 Thread Ilya Zykov
> | > People did not like that. > | > | Didn't like what "if 1" or "return EBUSY"? > > The return EBUSY... > Ok, but bug will stay in the system, temporarily. fs/ptyfs/ptyfs_vfsops.c | 16 +++- kern/tty_ptm.c |9 - 2 files changed, 19 insertions(+), 6 deletions

Re: Enhance ptyfs to handle multiple instances.

2014-03-19 Thread Ilya Zykov
> | *--bp = '\0'; > | - error = getcwd_common(cwdi->cwdi_rdir, rootvnode, &bp, > | + error = getcwd_common(mp->mnt_vnodecovered, cwdi->cwdi_rdir, &bp, > | buf, MAXBUF / 2, 0, l); > > Might as well pass NULL for cwdi->cwdi_rdir, since it does the same. > But it is less obvious, an

Re: Enhance ptyfs to handle multiple instances.

2014-03-19 Thread Ilya Zykov
Hello! For not accumulate many changes and keep patch clear. I am sending some error fix and modifications for future work and discussion too. Please, if possible, include it in current tree. Little explanations: 1. We shouldn't mount more than one ptyfs.(dependency from unmount order). Pa

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Ilya Zykov
> > if the first mount can only have [0..n-1] the second [n...2*n] etc... > "165:0 165:1" is ptm[x] first instance devices. "165:2 165:3" is ptm[x] second instance devices ... Every instance can have [0..N] pts devices. Ilya.

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Ilya Zykov
On 14.03.2014 18:40, Christos Zoulas wrote: > In article <20140314143532.ga17...@britannica.bec.de>, > Joerg Sonnenberger wrote: >> On Fri, Mar 14, 2014 at 09:51:12AM -0400, Christos Zoulas wrote: >>> I don't think that putting ptmx inside devpts makes sense. OTOH, we >>> could have multiple ptmx

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Ilya Zykov
On 14.03.2014 17:51, Christos Zoulas wrote: > On Mar 14, 5:29pm, net...@izyk.ru (Ilya Zykov) wrote: > -- Subject: Re: Enhance ptyfs to handle multiple instances. > > | Ok. > | > | 1. The main problem and question in this project(IMHO), it's how get access > for

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Ilya Zykov
> > | I have few questions about project. > | Christos, can I ask you about this? > | Please, if anybody has objections or already doing it, tell me know. > > Nobody is already doing it, and if you have questions, you came to the right > place. > > christos > Ok. 1. The main problem and quest

Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Ilya Zykov
Hello! I desire develop this project. About me. I am system administrator in little Italy-Russia's firm. I live in Moscow. OS kernel it's my hobby mainly. I have free time now and can do this project about 1-2 months. I have little experience with Linux kernel's tty layer and few accepted patches.