summaryrefslogtreecommitdiffstats
path: root/fs/devpts/inode.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-22 23:46:24 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-22 23:46:24 +0100
commitbb27d4998a9e8767674e8eda225c82cc149e5bc8 (patch)
treedcabb8b8cc510003637323b30ed414b1a1ec86f6 /fs/devpts/inode.c
parentstaging: wilc1000: wilc_wfi_netdevice: Remove header files (diff)
parentmei: fix format string in debug prints (diff)
downloadlinux-bb27d4998a9e8767674e8eda225c82cc149e5bc8.tar.xz
linux-bb27d4998a9e8767674e8eda225c82cc149e5bc8.zip
Merge char-misc-next into staging-next
This resolves the merge issues and confusions people were having with the goldfish drivers due to changes for them showing up in two different trees. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/devpts/inode.c')
-rw-r--r--fs/devpts/inode.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 1f107fd51328..655f21f99160 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -575,6 +575,26 @@ void devpts_kill_index(struct inode *ptmx_inode, int idx)
mutex_unlock(&allocated_ptys_lock);
}
+/*
+ * pty code needs to hold extra references in case of last /dev/tty close
+ */
+
+void devpts_add_ref(struct inode *ptmx_inode)
+{
+ struct super_block *sb = pts_sb_from_inode(ptmx_inode);
+
+ atomic_inc(&sb->s_active);
+ ihold(ptmx_inode);
+}
+
+void devpts_del_ref(struct inode *ptmx_inode)
+{
+ struct super_block *sb = pts_sb_from_inode(ptmx_inode);
+
+ iput(ptmx_inode);
+ deactivate_super(sb);
+}
+
/**
* devpts_pty_new -- create a new inode in /dev/pts/
* @ptmx_inode: inode of the master