Thread Synch AOSV 2020  1.2
LKM for exchanging messages between threads
sysfs.h
Go to the documentation of this file.
1 
6 #ifndef SYSFS_H
7 #define SYSFS_H
8 
9 
10 #include <linux/fs.h> /* Header for the Linux file system support */
11 #include <linux/kobject.h>
12 #include <uapi/linux/stat.h> /* S_IRUSR, S_IWUSR */
13 
14 #include <linux/kernel.h> /* TODO: For printk, remove after debugging*/
15 #include <linux/rwsem.h>
16 #include <linux/uaccess.h> //For copy_to_user/copy_from_user
17 
18 #include <linux/cred.h> //For current_uid()
19 
20 #include "types.h"
21 
22 
23 
24 #define ATTR_BUFF_SIZE 64
25 
26 
27 
28 static ssize_t max_msg_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf);
29 static ssize_t max_msg_size_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count);
30 static ssize_t max_storage_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf);
31 static ssize_t max_storage_size_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count);
32 static ssize_t current_storage_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf);
33 static ssize_t garbage_collector_ratio_show(struct kobject *kobj, struct kobj_attribute *attr, char *user_buff);
34 static ssize_t garbage_collector_ratio_store(struct kobject *kobj, struct kobj_attribute *attr, const char *user_buf, size_t count);
35 
36 
37 
38 int initSysFs(group_data *grp_data);
39 void releaseSysFs(group_sysfs_t *sysfs);
40 
41 
42 
43 
44 #endif //SYSFS_H
types.h
Defines all structures and global variables needed by the module.
group_data
Group device data structure.
Definition: types.h:207
releaseSysFs
void releaseSysFs(group_sysfs_t *sysfs)
Deallocate all sysfs attributes.
Definition: sysfs.c:637
initSysFs
int initSysFs(group_data *grp_data)
Initialize sysfs attributes.
Definition: sysfs.c:541