• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asus-wl-520gu-7.0.1.45/src/linux/linux/fs/nfs/

Lines Matching refs:inode

27 	struct inode		*inode;
40 static struct nfs_page * nfs_update_request(struct file*, struct inode *,
43 static void nfs_strategy(struct inode *inode);
51 # define IS_SWAPFILE(inode) (0)
85 nfs_write_attributes(struct inode *inode, struct nfs_fattr *fattr)
88 fattr->pre_size = NFS_CACHE_ISIZE(inode);
89 fattr->pre_mtime = NFS_CACHE_MTIME(inode);
90 fattr->pre_ctime = NFS_CACHE_CTIME(inode);
93 return nfs_refresh_inode(inode, fattr);
101 nfs_writepage_sync(struct file *file, struct inode *inode, struct page *page,
106 unsigned int wsize = NFS_SERVER(inode)->wsize;
116 cred = get_rpccred(NFS_I(inode)->mm_cred);
119 inode->i_dev, (long long)NFS_FILEID(inode),
124 flags = ((IS_SWAPFILE(inode)) ? NFS_RW_SWAP : 0) | NFS_RW_SYNC;
127 if (count < wsize && !IS_SWAPFILE(inode))
130 result = NFS_PROTO(inode)->write(inode, cred, &fattr, flags,
132 nfs_write_attributes(inode, &fattr);
149 * If we've extended the file, update the inode
152 if (base > inode->i_size)
153 inode->i_size = base;
167 nfs_writepage_async(struct file *file, struct inode *inode, struct page *page,
174 req = nfs_update_request(file, inode, page, offset, count);
179 req->wb_cred = get_rpccred(NFS_I(inode)->mm_cred);
181 nfs_strategy(inode);
183 if (inode->i_size < end)
184 inode->i_size = end;
196 struct inode *inode = page->mapping->host;
201 end_index = inode->i_size >> PAGE_CACHE_SHIFT;
204 nfs_wb_page(inode,page);
210 offset = inode->i_size & (PAGE_CACHE_SIZE-1);
218 if (NFS_SERVER(inode)->wsize >= PAGE_CACHE_SIZE && !IS_SYNC(inode)) {
219 err = nfs_writepage_async(NULL, inode, page, 0, offset);
223 err = nfs_writepage_sync(NULL, inode, page, 0, offset);
238 region_locked(struct inode *inode, struct nfs_page *req)
244 if (NFS_SERVER(inode)->flags & NFS_MOUNT_NONLM)
249 for (fl = inode->i_flock; fl; fl = fl->fl_next) {
261 * Insert a write request into an inode
267 nfs_inode_add_request(struct inode *inode, struct nfs_page *req)
276 head = &inode->u.nfs_i.writeback;
278 igrab(inode);
284 inode->u.nfs_i.npages++;
290 * Insert a write request into an inode
295 struct inode *inode;
303 inode = req->wb_inode;
306 inode->u.nfs_i.npages--;
307 if ((inode->u.nfs_i.npages == 0) != list_empty(&inode->u.nfs_i.writeback))
309 if (list_empty(&inode->u.nfs_i.writeback)) {
311 iput(inode);
322 _nfs_find_request(struct inode *inode, struct page *page)
327 head = &inode->u.nfs_i.writeback;
343 nfs_find_request(struct inode *inode, struct page *page)
348 req = _nfs_find_request(inode, page);
354 * Add a request to the inode's dirty list.
359 struct inode *inode = req->wb_inode;
362 nfs_list_add_request(req, &inode->u.nfs_i.dirty);
363 inode->u.nfs_i.ndirty++;
365 __nfs_add_lru(&NFS_SERVER(inode)->lru_dirty, req);
367 mark_inode_dirty(inode);
376 struct inode *inode = req->wb_inode;
377 return !list_empty(&req->wb_list) && req->wb_list_head == &inode->u.nfs_i.dirty;
382 * Add a request to the inode's commit list.
387 struct inode *inode = req->wb_inode;
390 nfs_list_add_request(req, &inode->u.nfs_i.commit);
391 inode->u.nfs_i.ncommit++;
393 __nfs_add_lru(&NFS_SERVER(inode)->lru_commit, req);
395 mark_inode_dirty(inode);
405 nfs_wait_on_requests(struct inode *inode, struct file *file, unsigned long idx_start, unsigned int npages)
417 head = &inode->u.nfs_i.writeback;
460 struct inode *inode;
465 inode = nfs_list_entry(dst->next)->wb_inode;
466 inode->u.nfs_i.ndirty -= npages;
483 struct inode *inode;
488 inode = nfs_list_entry(dst->next)->wb_inode;
489 inode->u.nfs_i.ndirty -= npages;
495 * nfs_scan_dirty - Scan an inode for dirty requests
496 * @inode: NFS inode to scan
502 * Moves requests from the inode's dirty page list.
506 nfs_scan_dirty(struct inode *inode, struct list_head *dst, struct file *file, unsigned long idx_start, unsigned int npages)
509 res = nfs_scan_list(&inode->u.nfs_i.dirty, dst, file, idx_start, npages);
510 inode->u.nfs_i.ndirty -= res;
511 if ((inode->u.nfs_i.ndirty == 0) != list_empty(&inode->u.nfs_i.dirty))
524 * requests that apply to the same inode.
531 struct inode *inode;
536 inode = nfs_list_entry(dst->next)->wb_inode;
537 npages += nfs_scan_list(&inode->u.nfs_i.commit, dst, NULL, 0, 0);
538 inode->u.nfs_i.ncommit -= npages;
551 * requests that apply to the same inode.
558 struct inode *inode;
563 inode = nfs_list_entry(dst->next)->wb_inode;
564 npages += nfs_scan_list(&inode->u.nfs_i.commit, dst, NULL, 0, 0);
565 inode->u.nfs_i.ncommit -= npages;
571 * nfs_scan_commit - Scan an inode for commit requests
572 * @inode: NFS inode to scan
578 * Moves requests from the inode's 'commit' request list.
582 nfs_scan_commit(struct inode *inode, struct list_head *dst, struct file *file, unsigned long idx_start, unsigned int npages)
585 res = nfs_scan_list(&inode->u.nfs_i.commit, dst, file, idx_start, npages);
586 inode->u.nfs_i.ncommit -= res;
587 if ((inode->u.nfs_i.ncommit == 0) != list_empty(&inode->u.nfs_i.commit))
602 nfs_update_request(struct file* file, struct inode *inode, struct page *page,
611 /* Loop over all inode entries and see if we find
615 req = _nfs_find_request(inode, page);
634 nfs_inode_add_request(inode, new);
641 new = nfs_create_request(nfs_file_cred(file), inode, page, offset, bytes);
649 if (region_locked(inode, new))
684 nfs_strategy(struct inode *inode)
688 dirty = inode->u.nfs_i.ndirty;
689 wpages = NFS_SERVER(inode)->wpages;
691 if (NFS_PROTO(inode)->version == 2) {
693 nfs_flush_file(inode, NULL, 0, 0, 0);
695 nfs_flush_file(inode, NULL, 0, 0, 0);
698 nfs_flush_file(inode, NULL, 0, 0, 0);
706 struct inode *inode = page->mapping->host;
717 req = nfs_find_request(inode,page);
720 status = nfs_wb_page(inode, page);
730 struct inode *inode = page->mapping->host;
743 if (NFS_SERVER(inode)->wsize < PAGE_CACHE_SIZE || IS_SYNC(inode))
744 return nfs_writepage_sync(file, inode, page, offset, count);
753 req = nfs_update_request(file, inode, page, offset, count);
758 status = nfs_wb_page(inode, page);
765 if (inode->i_size < end)
766 inode->i_size = end;
775 nfs_strategy(inode);
780 status, (long long)inode->i_size);
809 data->inode = req->wb_inode;
830 nfs_flush_one(struct list_head *head, struct inode *inode, int how)
832 struct rpc_clnt *clnt = NFS_CLIENT(inode);
837 nfsvers = NFS_PROTO(inode)->version,
856 if (!inode->u.nfs_i.ncommit)
880 inode->i_dev,
881 (long long)NFS_FILEID(inode),
938 struct inode *inode = data->inode;
975 NFS_SERVER(inode)->hostname,
982 nfs_write_attributes(inode, resp->fattr);
1031 struct inode *inode;
1041 inode = first->wb_inode;
1051 if (end >= inode->i_size || len < 0 || len > (~((u32)0) >> 1))
1054 data->inode = inode;
1056 data->args.fh = NFS_FH(inode);
1128 struct inode *inode = data->inode;
1136 nfs_write_attributes(inode, resp->fattr);
1171 int nfs_flush_file(struct inode *inode, struct file *file, unsigned long idx_start,
1179 res = nfs_scan_dirty(inode, &head, file, idx_start, npages);
1182 error = nfs_flush_list(&head, NFS_SERVER(inode)->wpages, how);
1189 int nfs_commit_file(struct inode *inode, struct file *file, unsigned long idx_start,
1197 res = nfs_scan_commit(inode, &head, file, idx_start, npages);
1207 int nfs_sync_file(struct inode *inode, struct file *file, unsigned long idx_start,
1216 if (!inode && file)
1217 inode = file->f_dentry->d_inode;
1222 error = nfs_wait_on_requests(inode, file, idx_start, npages);
1224 error = nfs_flush_file(inode, file, idx_start, npages, how);
1227 error = nfs_commit_file(inode, file, idx_start, npages, how);