Add some helper definitions to fs.h in the LinuxKPI.
Add a field to struct linux_file to allow the creation of anonymous shmem objects. MFC after: 1 week
This commit is contained in:
parent
07c668198e
commit
13bdb56c14
@ -80,8 +80,12 @@ struct linux_file {
|
||||
struct selinfo f_selinfo;
|
||||
struct sigio *f_sigio;
|
||||
struct vnode *f_vnode;
|
||||
#define f_inode f_vnode
|
||||
volatile u_int f_count;
|
||||
|
||||
/* anonymous shmem object */
|
||||
vm_object_t f_shmem;
|
||||
|
||||
/* kqfilter support */
|
||||
int f_kqflags;
|
||||
#define LINUX_KQ_FLAG_HAS_READ (1 << 0)
|
||||
@ -156,7 +160,8 @@ struct file_operations {
|
||||
int (*setlease)(struct file *, long, struct file_lock **);
|
||||
#endif
|
||||
};
|
||||
#define fops_get(fops) (fops)
|
||||
#define fops_get(fops) (fops)
|
||||
#define replace_fops(f, fops) ((f)->f_op = (fops))
|
||||
|
||||
#define FMODE_READ FREAD
|
||||
#define FMODE_WRITE FWRITE
|
||||
|
@ -463,6 +463,8 @@ void
|
||||
linux_file_free(struct linux_file *filp)
|
||||
{
|
||||
if (filp->_file == NULL) {
|
||||
if (filp->f_shmem != NULL)
|
||||
vm_object_deallocate(filp->f_shmem);
|
||||
kfree(filp);
|
||||
} else {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user