Skip to content

Commit

Permalink
TTY: devpts, document devpts inode operations
Browse files Browse the repository at this point in the history
Add kernel-doc texts for some devpts functions, i.e. document them.

Signed-off-by: Jiri Slaby <[email protected]>
Acked-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Jiri Slaby authored and gregkh committed Oct 22, 2012
1 parent f11afb6 commit 1dcb8e6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,15 @@ void devpts_kill_index(struct inode *ptmx_inode, int idx)
mutex_unlock(&allocated_ptys_lock);
}

/**
* devpts_pty_new -- create a new inode in /dev/pts/
* @ptmx_inode: inode of the master
* @device: major+minor of the node to be created
* @index: used as a name of the node
* @priv: what's given back by devpts_get_priv
*
* The created inode is returned. Remove it from /dev/pts/ by devpts_pty_kill.
*/
struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
void *priv)
{
Expand Down Expand Up @@ -585,6 +594,12 @@ struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
return inode;
}

/**
* devpts_get_priv -- get private data for a slave
* @pts_inode: inode of the slave
*
* Returns whatever was passed as priv in devpts_pty_new for a given inode.
*/
void *devpts_get_priv(struct inode *pts_inode)
{
struct dentry *dentry;
Expand All @@ -605,6 +620,12 @@ void *devpts_get_priv(struct inode *pts_inode)
return priv;
}

/**
* devpts_pty_kill -- remove inode form /dev/pts/
* @inode: inode of the slave to be removed
*
* This is an inverse operation of devpts_pty_new.
*/
void devpts_pty_kill(struct inode *inode)
{
struct super_block *sb = pts_sb_from_inode(inode);
Expand Down

0 comments on commit 1dcb8e6

Please sign in to comment.