.. | .. |
---|
487 | 487 | { |
---|
488 | 488 | unsigned long blocks; |
---|
489 | 489 | long long isize; |
---|
490 | | - struct rpc_clnt *clnt = NFS_CLIENT(file->f_mapping->host); |
---|
491 | | - struct inode *inode = file->f_mapping->host; |
---|
| 490 | + struct inode *inode = file_inode(file); |
---|
| 491 | + struct rpc_clnt *clnt = NFS_CLIENT(inode); |
---|
| 492 | + struct nfs_client *cl = NFS_SERVER(inode)->nfs_client; |
---|
492 | 493 | |
---|
493 | 494 | spin_lock(&inode->i_lock); |
---|
494 | 495 | blocks = inode->i_blocks; |
---|
.. | .. |
---|
501 | 502 | |
---|
502 | 503 | *span = sis->pages; |
---|
503 | 504 | |
---|
| 505 | + |
---|
| 506 | + if (cl->rpc_ops->enable_swap) |
---|
| 507 | + cl->rpc_ops->enable_swap(inode); |
---|
| 508 | + |
---|
504 | 509 | return rpc_clnt_swap_activate(clnt); |
---|
505 | 510 | } |
---|
506 | 511 | |
---|
507 | 512 | static void nfs_swap_deactivate(struct file *file) |
---|
508 | 513 | { |
---|
509 | | - struct rpc_clnt *clnt = NFS_CLIENT(file->f_mapping->host); |
---|
| 514 | + struct inode *inode = file_inode(file); |
---|
| 515 | + struct rpc_clnt *clnt = NFS_CLIENT(inode); |
---|
| 516 | + struct nfs_client *cl = NFS_SERVER(inode)->nfs_client; |
---|
510 | 517 | |
---|
511 | 518 | rpc_clnt_swap_deactivate(clnt); |
---|
| 519 | + if (cl->rpc_ops->disable_swap) |
---|
| 520 | + cl->rpc_ops->disable_swap(file_inode(file)); |
---|
512 | 521 | } |
---|
513 | 522 | |
---|
514 | 523 | const struct address_space_operations nfs_file_aops = { |
---|