/** * vfs_lib_ring_buffer_open - ring buffer open file operation * @inode: opened inode * @file: opened file * * Open implementation. Makes sure only one open instance of a buffer is * done at a given moment. */ static int vfs_lib_ring_buffer_open(struct inode *inode, struct file *file) { struct lib_ring_buffer *buf = inode->i_private; file->private_data = buf; return lib_ring_buffer_open(inode, file, buf); }
/* * This is not used by anonymous file descriptors. This code is left * there if we ever want to implement an inode with open() operation. */ static int lttng_metadata_ring_buffer_open(struct inode *inode, struct file *file) { struct lttng_metadata_stream *stream = inode->i_private; struct lib_ring_buffer *buf = stream->priv; file->private_data = buf; /* * Since life-time of metadata cache differs from that of * session, we need to keep our own reference on the transport. */ if (!try_module_get(stream->transport->owner)) { printk(KERN_WARNING "LTT : Can't lock transport module.\n"); return -EBUSY; } return lib_ring_buffer_open(inode, file, buf); }