glendix
view netfs/cs.c @ 83:6fdffc287daf
Tutorial: How to process the written instructions in netfs
| author | Rahul Murmuria <rahul@murmuria.in> |
|---|---|
| date | Sat Apr 04 21:17:51 2009 -0500 (2009-04-04) |
| parents | 5fe1f801a6c6 |
| children | ef351368303b |
line source
1 /*
2 * Copyright 2009 Rahul Murmuria <rahul@murmuria.in>
3 * This file may be redistributed under the terms of the GNU GPL.
4 */
6 #define __NO_VERSION__
8 #include "net.h"
9 /*
10 * Create the files that we export.
11 */
13 void cs_create_files (struct super_block *sb, struct dentry *root)
14 {
15 static char *cs_tmp;
16 cs_tmp = kmalloc(TMPSIZE, GFP_KERNEL);
17 memset (cs_tmp, 0, TMPSIZE);
18 slashnet_create_file(sb, root, "cs", cs_tmp);
19 /*
20 * NOTE: cs_tmp should not be free'd here because the same memory
21 * is being assigned to inode->-_private in the main program.
22 * It is desirable to have this memory allotted for every file
23 * as long as the filesystem is mount on a directory.
24 */
26 }
28 /*
29 * Processing the written instructions
30 */
32 void slashnet_cs_process (struct file *filp)
33 {
34 char *tmp;
35 tmp = (char *)(filp->private_data);
36 strcat(tmp, ":processed");
37 }
