📄 subr.c
字号:
/* * Copyright (c) 1997-2003 Erez Zadok * Copyright (c) 2001-2003 Stony Brook University * Copyright (c) 1997-2000 Columbia University * * For specific licensing information, see the COPYING file distributed with * this package, or get one from ftp://ftp.filesystems.org/pub/fist/COPYING. * * This Copyright notice must be kept intact and distributed with all * fistgen sources INCLUDING sources generated by fistgen. *//* * $Id: subr.c,v 1.8 2002/12/27 20:19:03 ezk Exp $ */#ifdef HAVE_CONFIG_H# include <config.h>#endif /* HAVE_CONFIG_H */#ifdef FISTGEN# include "fist_wrapfs.h"#endif /* FISTGEN */#include "fist.h"#include "wrapfs.h"#error do not compile this file directly. it is only an example.#ifdef FIST_FILTER_DATA/* * return the number of bytes written */intwrapfs_encode_block(const char *from, char *to, int len, const vnode_t *this_vnode, const vfs_t *this_vfsp){ memcpy(to, from, len); return len;}intwrapfs_decode_block(const char *from, char *to, int len, const vnode_t *this_vnode, const vfs_t *this_vfsp){ memcpy(to, from, len); return len;}#endif /* FIST_FILTER_DATA */#ifdef FIST_FILTER_NAMEintwrapfs_encode_filename(const char *name, int length, char **encoded_name, int skip_dots, const vnode_t *this_vnode, const vfs_t *this_vfsp){ int encoded_length; encoded_length = length + 1; *encoded_name = kmalloc(encoded_length, GFP_KERNEL); memcpy(*encoded_name, name, length); (*encoded_name)[length] = '\0'; return encoded_length;}/* returns length of decoded string, or -1 if error */intwrapfs_decode_filename(const char *name, int length, char **decoded_name, int skip_dots, const vnode_t *this_vnode, const vfs_t *this_vfsp){ int error = 0; *decoded_name = kmalloc(length, GFP_KERNEL); memcpy(*decoded_name, name, length); error = length; return error;}#endif /* FIST_FILTER_NAME *//* * Local variables: * c-basic-offset: 4 * End: */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -