copyfs.fist
来自「Solaris操作系统下的过滤驱动程序, C源码程序.」· FIST 代码 · 共 72 行
FIST
72 行
%{#include "fist.h"%}debug off;filter sca;filter data;add_mk copyfs.mk;%%%%intcopyfs_encode_buffers(char *hidden_pages_data, /* A PAGE_SIZE buffer (already allocated) passed to us to fill in */ char *page_data, /* The data we are to encode */ int *need_to_call, unsigned to, /* how much to encode in page_data */ inode_t *inode, /* The inode in question */ vfs_t *vfs, /* vfs_t ??? unused */ void **opaque) /* Opaque data */ /* encodes the data in page_data into hidden_pages_data. Returns -errno for error, and the size of hidden_pages_data for success */{ print_entry_location(); memcpy(hidden_pages_data, page_data, to); *need_to_call = 0; print_exit_status(to); return(to);}intcopyfs_decode_buffers(int num_hidden_pages, /* The number of pages in hidden_pages_data */ char **hidden_pages_data, /* An array of pages containing encoded data */ char *page_data, /* A pre-allocated PAGE_SIZE buffer to write the decoded data to */ inode_t *inode, /* The inode of the file in question */ vfs_t *vfs, /* vfs_t, unused */ void *opaque) /* opaque data filled in by wrapfs_Sca_count_pages, containing an int, the starting offset within the first page of hidden_pages_data of the encoded page we want */ /* Returns -errno for error, or the number of bytes decoded on success (Should usually return PAGE_SIZE bytes) */{ int err = 0, tmp = 0; if (num_hidden_pages != 1) { printk("copyfs: Too many pages! (%d)\n",num_hidden_pages); err = -EIO; goto out; } tmp = (int) opaque; err = PAGE_CACHE_SIZE - tmp; memcpy(page_data,&(hidden_pages_data[0][tmp]), err); out: print_exit_status(err); return(err);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?