summaryrefslogtreecommitdiffstats
path: root/tapset/nfs_proc.stp
diff options
context:
space:
mode:
Diffstat (limited to 'tapset/nfs_proc.stp')
-rw-r--r--tapset/nfs_proc.stp36
1 files changed, 21 insertions, 15 deletions
diff --git a/tapset/nfs_proc.stp b/tapset/nfs_proc.stp
index b8226630..21e5371e 100644
--- a/tapset/nfs_proc.stp
+++ b/tapset/nfs_proc.stp
@@ -12,6 +12,7 @@
%{
__u32 get_ip(struct rpc_task * task)
{
+ /* FIXME: deref hazards! */
struct rpc_clnt * tk_client;
struct rpc_xprt * cl_xprt;
struct sockaddr_in *addr;
@@ -25,6 +26,7 @@
}
int get_prot(struct rpc_task * task)
{
+ /* FIXME: deref hazards! */
struct rpc_clnt * tk_client;
struct rpc_xprt * cl_xprt;
tk_client = task->tk_client;
@@ -40,18 +42,18 @@
function __i2n_ip_proto :long(dir:long,index:long) %{ /* pure */
int index = (int) (THIS->index);
struct inode * dir = (struct inode *)(THIS->dir);
- struct rpc_clnt * clnt = NFS_CLIENT(dir);
- struct rpc_xprt * cl_xprt = clnt->cl_xprt;
- struct sockaddr_in * addr = (struct sockaddr_in *)&(cl_xprt->addr);
+ struct rpc_clnt * clnt = NFS_CLIENT(dir); /* FIXME: deref hazard! */
+ struct rpc_xprt * cl_xprt = kread(&(clnt->cl_xprt));
if(index == 0) {
- if (addr->sin_family == AF_INET) {
+ if (kread(&(cl_xprt->addr.sin_family)) == AF_INET) {
/* Now consider ipv4 only */
- THIS->__retvalue = addr->sin_addr.s_addr;
+ THIS->__retvalue = kread(&(cl_xprt->addr.sin_addr.s_addr));
} else
THIS->__retvalue = 0;
} else
- THIS->__retvalue = cl_xprt->prot;
+ THIS->__retvalue = kread(&(cl_xprt->prot));
+ CATCH_DEREF_FAULT();
%}
/*
@@ -75,20 +77,23 @@ function __nfs_read_data_info:long (rdata :long,index :long) %{ /* pure */
THIS->__retvalue = get_prot(task);
break;
case 2:
- THIS->__retvalue = rres->count;
+ THIS->__retvalue = kread(&(rres->count));
break;
- case 3:
- THIS->__retvalue = rres->fattr->valid;
+ case 3: {
+ struct nfs_fattr *fattr = kread(&(rres->fattr));
+ THIS->__retvalue = kread(&(fattr->valid));
break;
+ }
#ifdef CONFIG_NFS_V4
case 4:
- THIS->__retvalue = rdata->timestamp;
+ THIS->__retvalue = kread(&(rdata->timestamp));
break;
#endif
default:
THIS->__retvalue = 0;
break;
}
+ CATCH_DEREF_FAULT();
%}
/*
@@ -114,16 +119,17 @@ function __nfs_write_data_info:long (wdata :long,index :long) %{ /* pure */
function __nfsv4_bitmask :long(dir:long,i:long) %{ /* pure */
int i = (int) (THIS->i);
- struct inode * dir = (struct inode *)(THIS->dir);
- struct nfs_server * server = NFS_SERVER(dir);
+ struct inode * dir = (struct inode *)(long)(THIS->dir);
+ struct nfs_server * server = NFS_SERVER(dir); /* FIXME: deref hazard! */
- THIS->__retvalue = server->attr_bitmask[i];
+ THIS->__retvalue = kread(&(server->attr_bitmask[i]));
+ CATCH_DEREF_FAULT();
%}
function __getfh_inode :long(dir:long) %{ /* pure */
- struct inode * dir = (struct inode *)(THIS->dir);
- struct nfs_fh * fh = NFS_FH(dir);
+ struct inode * dir = (struct inode *)(long)(THIS->dir);
+ struct nfs_fh * fh = NFS_FH(dir); /* FIXME: deref hazard! */
THIS->__retvalue =(long) fh;
%}