1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
%{
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/dcache.h>
#include <linux/sunrpc/sched.h>
#include <linux/sunrpc/clnt.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_mount.h>
%}
function nfs_mntflags:string(rawdata)
%{
char buf[1024], *ptr;
int i, cc;
static struct proc_nfs_info {
int flag;
char *str;
char *nostr;
} nfs_info[] = {
{ NFS_MOUNT_SOFT, ",soft", ",hard" },
{ NFS_MOUNT_INTR, ",intr", "" },
{ NFS_MOUNT_NOCTO, ",nocto", "" },
{ NFS_MOUNT_NOAC, ",noac", "" },
{ NFS_MOUNT_NONLM, ",nolock", "" },
{ NFS_MOUNT_NOACL, ",noacl", "" },
{ NFS_MOUNT_NORDIRPLUS, ",nordirplus", "" },
{ NFS_MOUNT_UNSHARED, ",nosharecache", "" },
{ 0, "", "" }
};
struct nfs_mount_data *data = (struct nfs_mount_data *)(long) THIS->rawdata;
ptr = buf;
for (i=0; nfs_info[i].flag != 0; i++) {
//if (data->flags & nfs_info[i].flag) {
cc = sprintf(ptr, "%s", nfs_info[i].str);
ptr += cc;
//}
}
strlcpy(THIS->__retvalue, buf,1024);
%}
|