Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[sfrench/cifs-2.6.git] / fs / nfs / proc.c
index 97669ed05500c6277387f1b0323d53b6face4950..03599bfe81cf878fb0a65f233b80aeb184146bb4 100644 (file)
@@ -63,17 +63,17 @@ nfs_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
        };
        int status;
 
-       dprintk("%s: call getattr\n", __FUNCTION__);
+       dprintk("%s: call getattr\n", __func__);
        nfs_fattr_init(fattr);
        status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0);
-       dprintk("%s: reply getattr: %d\n", __FUNCTION__, status);
+       dprintk("%s: reply getattr: %d\n", __func__, status);
        if (status)
                return status;
-       dprintk("%s: call statfs\n", __FUNCTION__);
+       dprintk("%s: call statfs\n", __func__);
        msg.rpc_proc = &nfs_procedures[NFSPROC_STATFS];
        msg.rpc_resp = &fsinfo;
        status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0);
-       dprintk("%s: reply statfs: %d\n", __FUNCTION__, status);
+       dprintk("%s: reply statfs: %d\n", __func__, status);
        if (status)
                return status;
        info->rtmax  = NFS_MAXDATA;
@@ -211,6 +211,7 @@ nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
        nfs_fattr_init(&fattr);
        dprintk("NFS call  create %s\n", dentry->d_name.name);
        status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
+       nfs_mark_for_revalidate(dir);
        if (status == 0)
                status = nfs_instantiate(dentry, &fhandle, &fattr);
        dprintk("NFS reply create: %d\n", status);
@@ -564,16 +565,9 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data)
        return 0;
 }
 
-static void nfs_proc_read_setup(struct nfs_read_data *data)
+static void nfs_proc_read_setup(struct nfs_read_data *data, struct rpc_message *msg)
 {
-       struct rpc_message      msg = {
-               .rpc_proc       = &nfs_procedures[NFSPROC_READ],
-               .rpc_argp       = &data->args,
-               .rpc_resp       = &data->res,
-               .rpc_cred       = data->cred,
-       };
-
-       rpc_call_setup(&data->task, &msg, 0);
+       msg->rpc_proc = &nfs_procedures[NFSPROC_READ];
 }
 
 static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data)
@@ -583,24 +577,15 @@ static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data)
        return 0;
 }
 
-static void nfs_proc_write_setup(struct nfs_write_data *data, int how)
+static void nfs_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg)
 {
-       struct rpc_message      msg = {
-               .rpc_proc       = &nfs_procedures[NFSPROC_WRITE],
-               .rpc_argp       = &data->args,
-               .rpc_resp       = &data->res,
-               .rpc_cred       = data->cred,
-       };
-
        /* Note: NFSv2 ignores @stable and always uses NFS_FILE_SYNC */
        data->args.stable = NFS_FILE_SYNC;
-
-       /* Finalize the task. */
-       rpc_call_setup(&data->task, &msg, 0);
+       msg->rpc_proc = &nfs_procedures[NFSPROC_WRITE];
 }
 
 static void
-nfs_proc_commit_setup(struct nfs_write_data *data, int how)
+nfs_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg)
 {
        BUG();
 }
@@ -608,7 +593,9 @@ nfs_proc_commit_setup(struct nfs_write_data *data, int how)
 static int
 nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
 {
-       return nlmclnt_proc(filp->f_path.dentry->d_inode, cmd, fl);
+       struct inode *inode = filp->f_path.dentry->d_inode;
+
+       return nlmclnt_proc(NFS_SERVER(inode)->nlm_host, cmd, fl);
 }