Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
miscdev.c File Reference
#include <linux/fs.h>
#include <linux/hash.h>
#include <linux/random.h>
#include <linux/miscdevice.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/module.h>
#include "ecryptfs_kernel.h"

Go to the source code of this file.

Macros

#define PKT_TYPE_SIZE   1
 
#define PKT_CTR_SIZE   4
 
#define MIN_NON_MSG_PKT_SIZE   (PKT_TYPE_SIZE + PKT_CTR_SIZE)
 
#define MIN_MSG_PKT_SIZE
 
#define MAX_MSG_PKT_SIZE
 
#define PKT_TYPE_OFFSET   0
 
#define PKT_CTR_OFFSET   PKT_TYPE_SIZE
 
#define PKT_LEN_OFFSET   (PKT_TYPE_SIZE + PKT_CTR_SIZE)
 

Functions

int ecryptfs_send_miscdev (char *data, size_t data_size, struct ecryptfs_msg_ctx *msg_ctx, u8 msg_type, u16 msg_flags, struct ecryptfs_daemon *daemon)
 
int __init ecryptfs_init_ecryptfs_miscdev (void)
 
void ecryptfs_destroy_ecryptfs_miscdev (void)
 

Macro Definition Documentation

#define MAX_MSG_PKT_SIZE
Value:

Definition at line 217 of file miscdev.c.

#define MIN_MSG_PKT_SIZE
Value:

Definition at line 214 of file miscdev.c.

#define MIN_NON_MSG_PKT_SIZE   (PKT_TYPE_SIZE + PKT_CTR_SIZE)

Definition at line 213 of file miscdev.c.

#define PKT_CTR_OFFSET   PKT_TYPE_SIZE

Definition at line 222 of file miscdev.c.

#define PKT_CTR_SIZE   4

Definition at line 212 of file miscdev.c.

#define PKT_LEN_OFFSET   (PKT_TYPE_SIZE + PKT_CTR_SIZE)

Definition at line 223 of file miscdev.c.

#define PKT_TYPE_OFFSET   0

Definition at line 221 of file miscdev.c.

#define PKT_TYPE_SIZE   1

Definition at line 211 of file miscdev.c.

Function Documentation

void ecryptfs_destroy_ecryptfs_miscdev ( void  )

ecryptfs_destroy_ecryptfs_miscdev

All of the daemons must be exorcised prior to calling this function.

Definition at line 517 of file miscdev.c.

int __init ecryptfs_init_ecryptfs_miscdev ( void  )

ecryptfs_init_ecryptfs_miscdev

Messages sent to the userspace daemon from the kernel are placed on a queue associated with the daemon. The next read against the miscdev handle by that daemon will return the oldest message placed on the message queue for the daemon.

Returns zero on success; non-zero otherwise

Definition at line 498 of file miscdev.c.

int ecryptfs_send_miscdev ( char data,
size_t  data_size,
struct ecryptfs_msg_ctx msg_ctx,
u8  msg_type,
u16  msg_flags,
struct ecryptfs_daemon daemon 
)

ecryptfs_send_miscdev : Data to send to daemon; may be NULL : Amount of data to send to daemon : Message context, which is used to handle the reply. If this is NULL, then we do not expect a reply. : Type of message : Flags for message : eCryptfs daemon object

Add msg_ctx to queue and then, if it exists, notify the blocked miscdevess about the data being available. Must be called with ecryptfs_daemon_hash_mux held.

Returns zero on success; non-zero otherwise

Definition at line 170 of file miscdev.c.