patch-2.2.19 linux/fs/nfs/proc.c
Next file: linux/fs/nfs/read.c
Previous file: linux/fs/nfs/nfs3proc.c
Back to the patch index
Back to the overall index
- Lines: 319
- Date:
Sun Mar 25 11:37:38 2001
- Orig file:
v2.2.18/fs/nfs/proc.c
- Orig date:
Sun Mar 25 11:28:33 2001
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.18/fs/nfs/proc.c linux/fs/nfs/proc.c
@@ -77,34 +77,34 @@
* One function for each procedure in the NFS protocol.
*/
static int
-nfs_proc_getattr(struct dentry *dentry, fattr *fattr)
+nfs_proc_getattr(struct inode *inode, fattr *fattr)
{
int status;
dprintk("NFS call getattr\n");
fattr->valid = 0;
- status = rpc_call(NFS_CLIENT(dentry->d_inode), NFSPROC_GETATTR,
- NFS_FH(dentry), fattr, 0);
+ status = rpc_call(NFS_CLIENT(inode), NFSPROC_GETATTR,
+ NFS_FH(inode), fattr, 0);
dprintk("NFS reply getattr\n");
return status;
}
static int
-nfs_proc_setattr(struct dentry *dentry, fattr *fattr,
+nfs_proc_setattr(struct inode *inode, fattr *fattr,
struct iattr *sattr)
{
- struct nfs_sattrargs arg = { NFS_FH(dentry), sattr };
+ struct nfs_sattrargs arg = { NFS_FH(inode), sattr };
int status;
dprintk("NFS call setattr\n");
fattr->valid = 0;
- status = rpc_call(NFS_CLIENT(dentry->d_inode), NFSPROC_SETATTR, &arg, fattr, 0);
+ status = rpc_call(NFS_CLIENT(inode), NFSPROC_SETATTR, &arg, fattr, 0);
dprintk("NFS reply setattr\n");
return status;
}
static int
-nfs_proc_lookup(struct dentry *dir, fattr *dir_attr, qstr *name,
+nfs_proc_lookup(struct inode *dir, qstr *name,
struct nfs_fh *fhandle, fattr *fattr)
{
struct nfs_diropargs arg = { NFS_FH(dir), name->name, name->len };
@@ -112,36 +112,32 @@
int status;
dprintk("NFS call lookup %s\n", name->name);
- dir_attr->valid = 0;
fattr->valid = 0;
- status = rpc_call(NFS_CLIENT(dir->d_inode), NFSPROC_LOOKUP, &arg, &res, 0);
+ status = rpc_call(NFS_CLIENT(dir), NFSPROC_LOOKUP, &arg, &res, 0);
dprintk("NFS reply lookup: %d\n", status);
return status;
}
static int
-nfs_proc_readlink(struct dentry *dentry, fattr *fattr,
- void *buffer, unsigned int bufsiz)
+nfs_proc_readlink(struct inode *inode, void *buffer, unsigned int bufsiz)
{
- struct nfs_readlinkargs args = { NFS_FH(dentry), buffer, bufsiz };
+ struct nfs_readlinkargs args = { NFS_FH(inode), buffer, bufsiz };
struct nfs_readlinkres res = { buffer, bufsiz };
int status;
dprintk("NFS call readlink\n");
- fattr->valid = 0;
- status = rpc_call(NFS_CLIENT(dentry->d_inode), NFSPROC_READLINK,
+ status = rpc_call(NFS_CLIENT(inode), NFSPROC_READLINK,
&args, &res, 0);
dprintk("NFS reply readlink: %d\n", status);
return status;
}
static int
-nfs_proc_read(struct dentry *dentry, fattr *fattr,
- struct rpc_cred *cred, int flags,
- unsigned long offset, unsigned int count,
+nfs_proc_read(struct inode *inode, struct rpc_cred *cred, fattr *fattr,
+ int flags, unsigned long offset, unsigned int count,
void *buffer, int *eofp)
{
- struct nfs_readargs arg = { NFS_FH(dentry), offset, count, 1,
+ struct nfs_readargs arg = { NFS_FH(inode), offset, count, 1,
{{ buffer, count }, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}} };
struct nfs_readres res = { fattr, count, 0};
@@ -150,7 +146,7 @@
dprintk("NFS call read %d @ %ld\n", count, offset);
fattr->valid = 0;
- status = rpc_call_sync(NFS_CLIENT(dentry->d_inode), &msg, flags);
+ status = rpc_call_sync(NFS_CLIENT(inode), &msg, flags);
dprintk("NFS reply read: %d\n", status);
*eofp = res.eof;
@@ -158,12 +154,11 @@
}
static int
-nfs_proc_write(struct dentry *dentry, fattr *fattr,
- struct rpc_cred *cred, int how,
- unsigned long offset, unsigned int count,
+nfs_proc_write(struct inode *inode, struct rpc_cred *cred, fattr *fattr,
+ int how, unsigned long offset, unsigned int count,
void *buffer, struct nfs_writeverf *verf)
{
- struct nfs_writeargs arg = {NFS_FH(dentry), offset, count,
+ struct nfs_writeargs arg = {NFS_FH(inode), offset, count,
NFS_FILE_SYNC, 1,
{{buffer, count}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}}};
@@ -175,7 +170,7 @@
fattr->valid = 0;
if (how & NFS_RW_SWAP)
flags |= NFS_RPC_SWAPFLAGS;
- status = rpc_call_sync(NFS_CLIENT(dentry->d_inode), &msg, flags);
+ status = rpc_call_sync(NFS_CLIENT(inode), &msg, flags);
dprintk("NFS reply write: %d\n", status);
verf->committed = NFS_FILE_SYNC; /* NFSv2 always syncs data */
@@ -183,8 +178,7 @@
}
static int
-nfs_proc_create(struct dentry *dir, fattr *dir_attr,
- qstr *name, struct iattr *sattr, int flags,
+nfs_proc_create(struct inode *dir, qstr *name, struct iattr *sattr, int flags,
struct nfs_fh *fhandle, fattr *fattr)
{
struct nfs_createargs arg = { NFS_FH(dir), name->name,
@@ -192,10 +186,9 @@
struct nfs_diropok res = { fhandle, fattr };
int status;
- dir_attr->valid = 0;
fattr->valid = 0;
dprintk("NFS call create %s\n", name->name);
- status = rpc_call(NFS_CLIENT(dir->d_inode), NFSPROC_CREATE, &arg, &res, 0);
+ status = rpc_call(NFS_CLIENT(dir), NFSPROC_CREATE, &arg, &res, 0);
dprintk("NFS reply create: %d\n", status);
return status;
}
@@ -204,8 +197,7 @@
* In NFSv2, mknod is grafted onto the create call.
*/
static int
-nfs_proc_mknod(struct dentry *dir, fattr *dir_attr,
- qstr *name, struct iattr *sattr, dev_t rdev,
+nfs_proc_mknod(struct inode *dir, qstr *name, struct iattr *sattr, dev_t rdev,
struct nfs_fh *fhandle, fattr *fattr)
{
struct nfs_createargs arg = { NFS_FH(dir), name->name,
@@ -224,30 +216,27 @@
sattr->ia_size = rdev; /* get out your barf bag */
}
- dir_attr->valid = 0;
fattr->valid = 0;
- status = rpc_call(NFS_CLIENT(dir->d_inode), NFSPROC_CREATE, &arg, &res, 0);
+ status = rpc_call(NFS_CLIENT(dir), NFSPROC_CREATE, &arg, &res, 0);
if (status == -EINVAL && S_ISFIFO(mode)) {
sattr->ia_mode = mode;
- dir_attr->valid = 0;
fattr->valid = 0;
- status = rpc_call(NFS_CLIENT(dir->d_inode), NFSPROC_CREATE, &arg, &res, 0);
+ status = rpc_call(NFS_CLIENT(dir), NFSPROC_CREATE, &arg, &res, 0);
}
dprintk("NFS reply mknod: %d\n", status);
return status;
}
static int
-nfs_proc_remove(struct dentry *dir, fattr *dir_attr, qstr *name)
+nfs_proc_remove(struct inode *dir, qstr *name)
{
struct nfs_diropargs arg = { NFS_FH(dir), name->name, name->len };
struct rpc_message msg = { NFSPROC_REMOVE, &arg, NULL, NULL };
int status;
- dir_attr->valid = 0;
dprintk("NFS call remove %s\n", name->name);
- status = rpc_call_sync(NFS_CLIENT(dir->d_inode), &msg, 0);
+ status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
dprintk("NFS reply remove: %d\n", status);
return status;
@@ -262,7 +251,7 @@
if (!arg)
return -ENOMEM;
memset(arg, 0, sizeof(*arg));
- arg->fh = NFS_FH(dir);
+ arg->fh = NFS_FH(dir->d_inode);
arg->name = name->name;
arg->len = name->len;
msg->rpc_proc = NFSPROC_REMOVE;
@@ -280,8 +269,8 @@
}
static int
-nfs_proc_rename(struct dentry *old_dir, fattr *old_attr, qstr *old_name,
- struct dentry *new_dir, fattr *new_attr, qstr *new_name)
+nfs_proc_rename(struct inode *old_dir, qstr *old_name,
+ struct inode *new_dir, qstr *new_name)
{
struct nfs_renameargs arg = { NFS_FH(old_dir), old_name->name,
old_name->len,
@@ -290,32 +279,26 @@
int status;
dprintk("NFS call rename %s -> %s\n", old_name->name, new_name->name);
- old_attr->valid = 0;
- new_attr->valid = 0;
- status = rpc_call(NFS_CLIENT(old_dir->d_inode), NFSPROC_RENAME, &arg, NULL, 0);
+ status = rpc_call(NFS_CLIENT(old_dir), NFSPROC_RENAME, &arg, NULL, 0);
dprintk("NFS reply rename: %d\n", status);
return status;
}
static int
-nfs_proc_link(struct dentry *dentry, fattr *attr,
- struct dentry *dir, fattr *dir_attr, qstr *name)
+nfs_proc_link(struct inode *inode, struct inode *dir, qstr *name)
{
- struct nfs_linkargs arg = { NFS_FH(dentry), NFS_FH(dir),
+ struct nfs_linkargs arg = { NFS_FH(inode), NFS_FH(dir),
name->name, name->len };
int status;
dprintk("NFS call link %s\n", name->name);
- dir_attr->valid = 0;
- attr->valid = 0;
- status = rpc_call(NFS_CLIENT(dentry->d_inode), NFSPROC_LINK, &arg, NULL, 0);
+ status = rpc_call(NFS_CLIENT(inode), NFSPROC_LINK, &arg, NULL, 0);
dprintk("NFS reply link: %d\n", status);
return status;
}
static int
-nfs_proc_symlink(struct dentry *dir, fattr *dir_attr, qstr *name,
- qstr *path, struct iattr *sattr,
+nfs_proc_symlink(struct inode *dir, qstr *name, qstr *path, struct iattr *sattr,
struct nfs_fh *sym_fh, fattr *sym_attr)
{
struct nfs_symlinkargs arg = { NFS_FH(dir), name->name, name->len,
@@ -323,16 +306,14 @@
int status;
dprintk("NFS call symlink %s -> %s\n", name->name, path->name);
- dir_attr->valid = 0;
sym_attr->valid = 0;
- status = rpc_call(NFS_CLIENT(dir->d_inode), NFSPROC_SYMLINK, &arg, NULL, 0);
+ status = rpc_call(NFS_CLIENT(dir), NFSPROC_SYMLINK, &arg, NULL, 0);
dprintk("NFS reply symlink: %d\n", status);
return status;
}
static int
-nfs_proc_mkdir(struct dentry *dir, fattr *dir_attr, qstr *name,
- struct iattr *sattr,
+nfs_proc_mkdir(struct inode *dir, qstr *name, struct iattr *sattr,
struct nfs_fh *fhandle, fattr *fattr)
{
struct nfs_createargs arg = { NFS_FH(dir), name->name, name->len,
@@ -341,22 +322,20 @@
int status;
dprintk("NFS call mkdir %s\n", name->name);
- dir_attr->valid = 0;
fattr->valid = 0;
- status = rpc_call(NFS_CLIENT(dir->d_inode), NFSPROC_MKDIR, &arg, &res, 0);
+ status = rpc_call(NFS_CLIENT(dir), NFSPROC_MKDIR, &arg, &res, 0);
dprintk("NFS reply mkdir: %d\n", status);
return status;
}
static int
-nfs_proc_rmdir(struct dentry *dir, fattr *dir_attr, qstr *name)
+nfs_proc_rmdir(struct inode *dir, qstr *name)
{
struct nfs_diropargs arg = { NFS_FH(dir), name->name, name->len };
int status;
dprintk("NFS call rmdir %s\n", name->name);
- dir_attr->valid = 0;
- status = rpc_call(NFS_CLIENT(dir->d_inode), NFSPROC_RMDIR, &arg, NULL, 0);
+ status = rpc_call(NFS_CLIENT(dir), NFSPROC_RMDIR, &arg, NULL, 0);
dprintk("NFS reply rmdir: %d\n", status);
return status;
}
@@ -369,8 +348,7 @@
* from nfs_readdir by calling the decode_entry function directly.
*/
static int
-nfs_proc_readdir(struct dentry *dir, fattr *dir_attr,
- struct rpc_cred *cred,
+nfs_proc_readdir(struct inode *dir, struct rpc_cred *cred,
__u64 cookie, void *entry, unsigned int size, int plus)
{
struct nfs_readdirargs arg;
@@ -378,7 +356,6 @@
struct rpc_message msg = { NFSPROC_READDIR, &arg, &res, cred };
int status;
- dir_attr->valid = 0;
arg.fh = NFS_FH(dir);
arg.cookie = cookie;
arg.buffer = entry;
@@ -386,9 +363,8 @@
res.buffer = entry;
res.bufsiz = size;
- dir_attr->valid = 0;
dprintk("NFS call readdir %d\n", (unsigned int)cookie);
- status = rpc_call_sync(NFS_CLIENT(dir->d_inode), &msg, 0);
+ status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
dprintk("NFS reply readdir: %d\n", status);
return status;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)