diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-09 09:34:22 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-09 09:34:22 -0400 |
commit | 683b57b435326eb512c7305892683b6205669448 (patch) | |
tree | ca1e526ab5b27993c0c143c37bb31e18889eeb61 /fs/nfs/nfs4proc.c | |
parent | 8b23ea7bedb8b45a5bb56745fa3ff11018acf04e (diff) |
NFSv4: Implement the fs_locations function call
NFSv4 allows for the fact that filesystems may be replicated across
several servers or that they may be migrated to a backup server in case of
failure of the primary server.
fs_locations is an NFSv4 operation for retrieving information about the
location of migrated and/or replicated filesystems.
Based on an initial implementation by Jiaying Zhang <jiayingz@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 308407205e6c..768514dc0c4c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3570,6 +3570,35 @@ ssize_t nfs4_listxattr(struct dentry *dentry, char *buf, size_t buflen) | |||
3570 | return len; | 3570 | return len; |
3571 | } | 3571 | } |
3572 | 3572 | ||
3573 | int nfs4_proc_fs_locations(struct inode *dir, struct dentry *dentry, | ||
3574 | struct nfs_fs_locations *fs_locations, struct page *page) | ||
3575 | { | ||
3576 | struct nfs_server *server = NFS_SERVER(dir); | ||
3577 | u32 bitmask[2] = { | ||
3578 | [0] = server->attr_bitmask[0] | FATTR4_WORD0_FS_LOCATIONS, | ||
3579 | [1] = server->attr_bitmask[1], | ||
3580 | }; | ||
3581 | struct nfs4_fs_locations_arg args = { | ||
3582 | .dir_fh = NFS_FH(dir), | ||
3583 | .name = &dentry->d_name, | ||
3584 | .page = page, | ||
3585 | .bitmask = bitmask, | ||
3586 | }; | ||
3587 | struct rpc_message msg = { | ||
3588 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_FS_LOCATIONS], | ||
3589 | .rpc_argp = &args, | ||
3590 | .rpc_resp = &fs_locations, | ||
3591 | }; | ||
3592 | int status; | ||
3593 | |||
3594 | dprintk("%s: start\n", __FUNCTION__); | ||
3595 | fs_locations->fattr.valid = 0; | ||
3596 | fs_locations->server = server; | ||
3597 | status = rpc_call_sync(server->client, &msg, 0); | ||
3598 | dprintk("%s: returned status = %d\n", __FUNCTION__, status); | ||
3599 | return status; | ||
3600 | } | ||
3601 | |||
3573 | struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = { | 3602 | struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = { |
3574 | .recover_open = nfs4_open_reclaim, | 3603 | .recover_open = nfs4_open_reclaim, |
3575 | .recover_lock = nfs4_lock_reclaim, | 3604 | .recover_lock = nfs4_lock_reclaim, |