aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/devpts/inode.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 7a20d673bb8a..472e6befc54d 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -545,6 +545,15 @@ void devpts_kill_index(struct inode *ptmx_inode, int idx)
545 mutex_unlock(&allocated_ptys_lock); 545 mutex_unlock(&allocated_ptys_lock);
546} 546}
547 547
548/**
549 * devpts_pty_new -- create a new inode in /dev/pts/
550 * @ptmx_inode: inode of the master
551 * @device: major+minor of the node to be created
552 * @index: used as a name of the node
553 * @priv: what's given back by devpts_get_priv
554 *
555 * The created inode is returned. Remove it from /dev/pts/ by devpts_pty_kill.
556 */
548struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, 557struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
549 void *priv) 558 void *priv)
550{ 559{
@@ -585,6 +594,12 @@ struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
585 return inode; 594 return inode;
586} 595}
587 596
597/**
598 * devpts_get_priv -- get private data for a slave
599 * @pts_inode: inode of the slave
600 *
601 * Returns whatever was passed as priv in devpts_pty_new for a given inode.
602 */
588void *devpts_get_priv(struct inode *pts_inode) 603void *devpts_get_priv(struct inode *pts_inode)
589{ 604{
590 struct dentry *dentry; 605 struct dentry *dentry;
@@ -605,6 +620,12 @@ void *devpts_get_priv(struct inode *pts_inode)
605 return priv; 620 return priv;
606} 621}
607 622
623/**
624 * devpts_pty_kill -- remove inode form /dev/pts/
625 * @inode: inode of the slave to be removed
626 *
627 * This is an inverse operation of devpts_pty_new.
628 */
608void devpts_pty_kill(struct inode *inode) 629void devpts_pty_kill(struct inode *inode)
609{ 630{
610 struct super_block *sb = pts_sb_from_inode(inode); 631 struct super_block *sb = pts_sb_from_inode(inode);