patch-2.4.0-test12 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: 289
- Date:
Sun Dec 3 18:01:01 2000
- Orig file:
v2.4.0-test11/linux/fs/nfs/proc.c
- Orig date:
Sun Oct 8 10:50:32 2000
diff -u --recursive --new-file v2.4.0-test11/linux/fs/nfs/proc.c linux/fs/nfs/proc.c
@@ -64,34 +64,34 @@
* One function for each procedure in the NFS protocol.
*/
static int
-nfs_proc_getattr(struct dentry *dentry, struct nfs_fattr *fattr)
+nfs_proc_getattr(struct inode *inode, struct nfs_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, struct nfs_fattr *fattr,
+nfs_proc_setattr(struct inode *inode, struct nfs_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, struct qstr *name,
+nfs_proc_lookup(struct inode *dir, struct qstr *name,
struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{
struct nfs_diropargs arg = { NFS_FH(dir), name->name, name->len };
@@ -100,32 +100,31 @@
dprintk("NFS call lookup %s\n", name->name);
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, 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");
- 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 file *file, struct nfs_fattr *fattr, int flags,
+nfs_proc_read(struct inode *inode, struct rpc_cred *cred,
+ struct nfs_fattr *fattr, int flags,
loff_t offset, unsigned int count, void *buffer, int *eofp)
{
- struct dentry *dentry = file->f_dentry;
- struct rpc_cred *cred = nfs_file_cred(file);
- 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};
@@ -134,7 +133,7 @@
dprintk("NFS call read %d @ %Ld\n", count, (long long)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;
@@ -142,13 +141,12 @@
}
static int
-nfs_proc_write(struct file *file, struct nfs_fattr *fattr, int how,
+nfs_proc_write(struct inode *inode, struct rpc_cred *cred,
+ struct nfs_fattr *fattr, int how,
loff_t offset, unsigned int count,
void *buffer, struct nfs_writeverf *verf)
{
- struct dentry *dentry = file->f_dentry;
- struct rpc_cred *cred = nfs_file_cred(file);
- 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}}};
@@ -160,7 +158,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 */
@@ -168,7 +166,7 @@
}
static int
-nfs_proc_create(struct dentry *dir, struct qstr *name, struct iattr *sattr,
+nfs_proc_create(struct inode *dir, struct qstr *name, struct iattr *sattr,
int flags, struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{
struct nfs_createargs arg = { NFS_FH(dir), name->name,
@@ -178,7 +176,7 @@
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;
}
@@ -187,7 +185,7 @@
* In NFSv2, mknod is grafted onto the create call.
*/
static int
-nfs_proc_mknod(struct dentry *dir, struct qstr *name, struct iattr *sattr,
+nfs_proc_mknod(struct inode *dir, struct qstr *name, struct iattr *sattr,
dev_t rdev, struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{
struct nfs_createargs arg = { NFS_FH(dir), name->name,
@@ -207,26 +205,26 @@
}
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;
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, struct qstr *name)
+nfs_proc_remove(struct inode *dir, struct qstr *name)
{
struct nfs_diropargs arg = { NFS_FH(dir), name->name, name->len };
struct rpc_message msg = { NFSPROC_REMOVE, &arg, NULL, NULL };
int status;
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;
@@ -240,7 +238,7 @@
arg = (struct nfs_diropargs *)kmalloc(sizeof(*arg), GFP_KERNEL);
if (!arg)
return -ENOMEM;
- 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;
@@ -258,8 +256,8 @@
}
static int
-nfs_proc_rename(struct dentry *old_dir, struct qstr *old_name,
- struct dentry *new_dir, struct qstr *new_name)
+nfs_proc_rename(struct inode *old_dir, struct qstr *old_name,
+ struct inode *new_dir, struct qstr *new_name)
{
struct nfs_renameargs arg = { NFS_FH(old_dir), old_name->name,
old_name->len,
@@ -268,26 +266,26 @@
int status;
dprintk("NFS call rename %s -> %s\n", old_name->name, new_name->name);
- 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, struct dentry *dir, struct qstr *name)
+nfs_proc_link(struct inode *inode, struct inode *dir, struct 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);
- 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, struct qstr *name, struct qstr *path,
+nfs_proc_symlink(struct inode *dir, struct qstr *name, struct qstr *path,
struct iattr *sattr, struct nfs_fh *fhandle,
struct nfs_fattr *fattr)
{
@@ -297,13 +295,13 @@
dprintk("NFS call symlink %s -> %s\n", name->name, path->name);
fattr->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, struct qstr *name, struct iattr *sattr,
+nfs_proc_mkdir(struct inode *dir, struct qstr *name, struct iattr *sattr,
struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{
struct nfs_createargs arg = { NFS_FH(dir), name->name, name->len,
@@ -313,19 +311,19 @@
dprintk("NFS call mkdir %s\n", name->name);
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, struct qstr *name)
+nfs_proc_rmdir(struct inode *dir, struct qstr *name)
{
struct nfs_diropargs arg = { NFS_FH(dir), name->name, name->len };
int status;
dprintk("NFS call rmdir %s\n", name->name);
- 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;
}
@@ -338,11 +336,10 @@
* from nfs_readdir by calling the decode_entry function directly.
*/
static int
-nfs_proc_readdir(struct file *file, __u64 cookie, void *entry,
+nfs_proc_readdir(struct inode *dir, struct rpc_cred *cred,
+ __u64 cookie, void *entry,
unsigned int size, int plus)
{
- struct dentry *dir = file->f_dentry;
- struct rpc_cred *cred = nfs_file_cred(file);
struct nfs_readdirargs arg;
struct nfs_readdirres res;
struct rpc_message msg = { NFSPROC_READDIR, &arg, &res, cred };
@@ -356,7 +353,7 @@
res.bufsiz = size;
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)