diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-01-29 01:41:54 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-01-29 01:41:54 +0000 |
commit | f969d69ba9f952e5bdd38278e25e26a3e4a61a70 (patch) | |
tree | b3530d803df59d726afaabebc6626987dee1ca05 /fs/nfs | |
parent | a10ce7ef2066b455d69187643ddf2073bfc4db24 (diff) |
Merge with 2.3.27.
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/dir.c | 62 | ||||
-rw-r--r-- | fs/nfs/inode.c | 2 | ||||
-rw-r--r-- | fs/nfs/mount_clnt.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs3xdr.c | 2 | ||||
-rw-r--r-- | fs/nfs/read.c | 8 | ||||
-rw-r--r-- | fs/nfs/write.c | 12 |
6 files changed, 35 insertions, 53 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 651b1152c..149077fae 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1200,12 +1200,12 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *old_inode = old_dentry->d_inode; struct inode *new_inode = new_dentry->d_inode; struct dentry *dentry = NULL; - int error, rehash = 0, update = 1; + int error, rehash = 0; dfprintk(VFS, "NFS: rename(%s/%s -> %s/%s, ct=%d)\n", - old_dentry->d_parent->d_name.name, old_dentry->d_name.name, - new_dentry->d_parent->d_name.name, new_dentry->d_name.name, - new_dentry->d_count); + old_dentry->d_parent->d_name.name, old_dentry->d_name.name, + new_dentry->d_parent->d_name.name, new_dentry->d_name.name, + new_dentry->d_count); /* * First check whether the target is busy ... we can't @@ -1238,21 +1238,16 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, /* dentry still busy? */ if (new_dentry->d_count > 1) { #ifdef NFS_PARANOIA -printk("nfs_rename: target %s/%s busy, d_count=%d\n", -new_dentry->d_parent->d_name.name,new_dentry->d_name.name,new_dentry->d_count); + printk("nfs_rename: target %s/%s busy, d_count=%d\n", + new_dentry->d_parent->d_name.name, + new_dentry->d_name.name, + new_dentry->d_count); #endif goto out; } } /* - * Check for within-directory rename ... no complications. - */ - if (new_dir == old_dir) - goto do_rename; - /* - * Cross-directory move ... - * * ... prune child dentries and writebacks if needed. */ if (old_dentry->d_count > 1) { @@ -1260,40 +1255,26 @@ new_dentry->d_parent->d_name.name,new_dentry->d_name.name,new_dentry->d_count); shrink_dcache_parent(old_dentry); } - /* - * Now check the use counts ... we can't safely do the - * rename unless we can drop the dentries first. - */ - if (old_dentry->d_count > 1) { -#ifdef NFS_PARANOIA -printk("nfs_rename: old dentry %s/%s busy, d_count=%d\n", -old_dentry->d_parent->d_name.name,old_dentry->d_name.name,old_dentry->d_count); -#endif - goto out; - } if (new_dentry->d_count > 1 && new_inode) { #ifdef NFS_PARANOIA -printk("nfs_rename: new dentry %s/%s busy, d_count=%d\n", -new_dentry->d_parent->d_name.name,new_dentry->d_name.name,new_dentry->d_count); + printk("nfs_rename: new dentry %s/%s busy, d_count=%d\n", + new_dentry->d_parent->d_name.name, + new_dentry->d_name.name, + new_dentry->d_count); #endif goto out; } - d_drop(old_dentry); - update = 0; - -do_rename: /* * To prevent any new references to the target during the rename, * we unhash the dentry and free the inode in advance. */ if (!list_empty(&new_dentry->d_hash)) { d_drop(new_dentry); - rehash = update; + rehash = 1; } - if (new_inode) { + if (new_inode) d_delete(new_dentry); - } invalidate_inode_pages(new_dir); nfs_flush_dircache(new_dir); @@ -1302,13 +1283,14 @@ do_rename: error = nfs_proc_rename(NFS_DSERVER(old_dentry), NFS_FH(old_dentry->d_parent), old_dentry->d_name.name, NFS_FH(new_dentry->d_parent), new_dentry->d_name.name); - if (!error && !S_ISDIR(old_inode->i_mode)) { - /* Update the dcache if needed */ - if (rehash) - d_add(new_dentry, NULL); - if (update) - d_move(old_dentry, new_dentry); - } + + NFS_CACHEINV(old_dir); + NFS_CACHEINV(new_dir); + /* Update the dcache if needed */ + if (rehash) + d_add(new_dentry, NULL); + if (!error && !S_ISDIR(old_inode->i_mode)) + d_move(old_dentry, new_dentry); out: /* new dentry created? */ diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index ab1e51485..00b310e06 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -680,7 +680,7 @@ printk("nfs_notify_change: revalidate failed, error=%d\n", error); */ if (attr->ia_valid & ATTR_SIZE) { if (attr->ia_size != fattr.size) - printk("nfs_notify_change: attr=%ld, fattr=%d??\n", + printk("nfs_notify_change: attr=%Ld, fattr=%d??\n", attr->ia_size, fattr.size); inode->i_size = attr->ia_size; inode->i_mtime = fattr.mtime.seconds; diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c index 3ecb9bfa6..f74984de2 100644 --- a/fs/nfs/mount_clnt.c +++ b/fs/nfs/mount_clnt.c @@ -119,7 +119,7 @@ static struct rpc_procinfo mnt_procedures[2] = { { "mnt_mount", (kxdrproc_t) xdr_encode_dirpath, (kxdrproc_t) xdr_decode_fhstatus, - MNT_dirpath_sz, MNT_fhstatus_sz }, + MNT_dirpath_sz << 2, 0 }, }; static struct rpc_version mnt_version1 = { diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index 6ef7b9282..beed6ec1e 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c @@ -679,7 +679,7 @@ nfs_get_info(char *buffer, char **start, off_t offset, int length, int dummy) static struct proc_dir_entry proc_nfsclnt = { 0, 3, "nfs", S_IFREG | S_IRUGO, 1, 0, 0, - 6, &proc_net_inode_operations, + 6, NULL, nfs_get_info }; diff --git a/fs/nfs/read.c b/fs/nfs/read.c index a85ef5e74..6b2e3d73a 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -70,7 +70,7 @@ static int nfs_readpage_sync(struct dentry *dentry, struct inode *inode, struct page *page) { struct nfs_rreq rqst; - unsigned long offset = page->offset; + unsigned long offset = page->index << PAGE_CACHE_SHIFT; char *buffer = (char *) page_address(page); int rsize = NFS_SERVER(inode)->rsize; int result, refresh = 0; @@ -179,7 +179,7 @@ nfs_readpage_async(struct dentry *dentry, struct inode *inode, /* Initialize request */ /* N.B. Will the dentry remain valid for life of request? */ - nfs_readreq_setup(req, NFS_FH(dentry), page->offset, + nfs_readreq_setup(req, NFS_FH(dentry), page->index << PAGE_CACHE_SHIFT, (void *) address, PAGE_SIZE); req->ra_inode = inode; req->ra_page = page; /* count has been incremented by caller */ @@ -224,8 +224,8 @@ nfs_readpage(struct file *file, struct page *page) int error; lock_kernel(); - dprintk("NFS: nfs_readpage (%p %ld@%ld)\n", - page, PAGE_SIZE, page->offset); + dprintk("NFS: nfs_readpage (%p %ld@%lu)\n", + page, PAGE_SIZE, page->index); get_page(page); /* diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 561e8450c..abc048dc2 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -95,12 +95,12 @@ nfs_writepage_sync(struct dentry *dentry, struct inode *inode, struct nfs_fattr fattr; lock_kernel(); - dprintk("NFS: nfs_writepage_sync(%s/%s %d@%ld)\n", + dprintk("NFS: nfs_writepage_sync(%s/%s %d@%lu/%ld)\n", dentry->d_parent->d_name.name, dentry->d_name.name, - count, page->offset + offset); + count, page->index, offset); buffer = (u8 *) page_address(page) + offset; - offset += page->offset; + offset += page->index << PAGE_CACHE_SHIFT; do { if (count < wsize && !IS_SWAPFILE(inode)) @@ -287,7 +287,7 @@ create_write_request(struct file * file, struct page *page, unsigned int offset, dprintk("NFS: create_write_request(%s/%s, %ld+%d)\n", dentry->d_parent->d_name.name, dentry->d_name.name, - page->offset + offset, bytes); + (page->index << PAGE_CACHE_SHIFT) + offset, bytes); /* FIXME: Enforce hard limit on number of concurrent writes? */ wreq = kmem_cache_alloc(nfs_wreq_cachep, SLAB_KERNEL); @@ -435,7 +435,7 @@ nfs_updatepage(struct file *file, struct page *page, unsigned long offset, unsig dprintk("NFS: nfs_updatepage(%s/%s %d@%ld)\n", dentry->d_parent->d_name.name, dentry->d_name.name, - count, page->offset+offset); + count, (page->index << PAGE_CACHE_SHIFT) +offset); /* * Try to find a corresponding request on the writeback queue. @@ -620,7 +620,7 @@ nfs_wback_begin(struct rpc_task *task) /* Setup the task struct for a writeback call */ req->wb_flags |= NFS_WRITE_INPROGRESS; req->wb_args.fh = NFS_FH(dentry); - req->wb_args.offset = page->offset + req->wb_offset; + req->wb_args.offset = (page->index << PAGE_CACHE_SHIFT) + req->wb_offset; req->wb_args.count = req->wb_bytes; req->wb_args.buffer = (void *) (page_address(page) + req->wb_offset); |