Merge branch 'for_linus' of git://git.linux-nfs.org/pub/linux/nfs-2.6

+59 -14
+1 -1
fs/nfs/file.c
··· 316 if (offset != 0) 317 return; 318 /* Cancel any unstarted writes on this page */ 319 - nfs_wb_page_priority(page->mapping->host, page, FLUSH_INVALIDATE); 320 } 321 322 static int nfs_release_page(struct page *page, gfp_t gfp)
··· 316 if (offset != 0) 317 return; 318 /* Cancel any unstarted writes on this page */ 319 + nfs_wb_page_cancel(page->mapping->host, page); 320 } 321 322 static int nfs_release_page(struct page *page, gfp_t gfp)
+1 -1
fs/nfs/namespace.c
··· 176 void nfs_release_automount_timer(void) 177 { 178 if (list_empty(&nfs_automount_list)) 179 - cancel_delayed_work_sync(&nfs_automount_task); 180 } 181 182 /*
··· 176 void nfs_release_automount_timer(void) 177 { 178 if (list_empty(&nfs_automount_list)) 179 + cancel_delayed_work(&nfs_automount_task); 180 } 181 182 /*
+2 -2
fs/nfs/nfs4proc.c
··· 646 rcu_read_lock(); 647 delegation = rcu_dereference(NFS_I(state->inode)->delegation); 648 if (delegation != NULL && (delegation->flags & NFS_DELEGATION_NEED_RECLAIM) != 0) 649 - delegation_type = delegation->flags; 650 rcu_read_unlock(); 651 opendata->o_arg.u.delegation_type = delegation_type; 652 status = nfs4_open_recover(opendata, state); ··· 1434 } 1435 res = d_add_unique(dentry, igrab(state->inode)); 1436 if (res != NULL) 1437 - dentry = res; 1438 nfs4_intent_set_file(nd, &path, state); 1439 return res; 1440 }
··· 646 rcu_read_lock(); 647 delegation = rcu_dereference(NFS_I(state->inode)->delegation); 648 if (delegation != NULL && (delegation->flags & NFS_DELEGATION_NEED_RECLAIM) != 0) 649 + delegation_type = delegation->type; 650 rcu_read_unlock(); 651 opendata->o_arg.u.delegation_type = delegation_type; 652 status = nfs4_open_recover(opendata, state); ··· 1434 } 1435 res = d_add_unique(dentry, igrab(state->inode)); 1436 if (res != NULL) 1437 + path.dentry = res; 1438 nfs4_intent_set_file(nd, &path, state); 1439 return res; 1440 }
+10 -10
fs/nfs/super.c
··· 911 kfree(string); 912 913 switch (token) { 914 - case Opt_udp: 915 mnt->flags &= ~NFS_MOUNT_TCP; 916 mnt->nfs_server.protocol = IPPROTO_UDP; 917 mnt->timeo = 7; 918 mnt->retrans = 5; 919 break; 920 - case Opt_tcp: 921 mnt->flags |= NFS_MOUNT_TCP; 922 mnt->nfs_server.protocol = IPPROTO_TCP; 923 mnt->timeo = 600; ··· 936 kfree(string); 937 938 switch (token) { 939 - case Opt_udp: 940 mnt->mount_server.protocol = IPPROTO_UDP; 941 break; 942 - case Opt_tcp: 943 mnt->mount_server.protocol = IPPROTO_TCP; 944 break; 945 default: ··· 1153 c = strchr(dev_name, ':'); 1154 if (c == NULL) 1155 return -EINVAL; 1156 - len = c - dev_name - 1; 1157 if (len > sizeof(data->hostname)) 1158 - return -EINVAL; 1159 strncpy(data->hostname, dev_name, len); 1160 args.nfs_server.hostname = data->hostname; 1161 1162 c++; 1163 if (strlen(c) > NFS_MAXPATHLEN) 1164 - return -EINVAL; 1165 args.nfs_server.export_path = c; 1166 1167 status = nfs_try_mount(&args, mntfh); 1168 if (status) 1169 - return -EINVAL; 1170 1171 /* 1172 * Translate to nfs_mount_data, which nfs_fill_super ··· 1677 /* while calculating len, pretend ':' is '\0' */ 1678 len = c - dev_name; 1679 if (len > NFS4_MAXNAMLEN) 1680 - return -EINVAL; 1681 *hostname = kzalloc(len, GFP_KERNEL); 1682 if (*hostname == NULL) 1683 return -ENOMEM; ··· 1686 c++; /* step over the ':' */ 1687 len = strlen(c); 1688 if (len > NFS4_MAXPATHLEN) 1689 - return -EINVAL; 1690 *mntpath = kzalloc(len + 1, GFP_KERNEL); 1691 if (*mntpath == NULL) 1692 return -ENOMEM;
··· 911 kfree(string); 912 913 switch (token) { 914 + case Opt_xprt_udp: 915 mnt->flags &= ~NFS_MOUNT_TCP; 916 mnt->nfs_server.protocol = IPPROTO_UDP; 917 mnt->timeo = 7; 918 mnt->retrans = 5; 919 break; 920 + case Opt_xprt_tcp: 921 mnt->flags |= NFS_MOUNT_TCP; 922 mnt->nfs_server.protocol = IPPROTO_TCP; 923 mnt->timeo = 600; ··· 936 kfree(string); 937 938 switch (token) { 939 + case Opt_xprt_udp: 940 mnt->mount_server.protocol = IPPROTO_UDP; 941 break; 942 + case Opt_xprt_tcp: 943 mnt->mount_server.protocol = IPPROTO_TCP; 944 break; 945 default: ··· 1153 c = strchr(dev_name, ':'); 1154 if (c == NULL) 1155 return -EINVAL; 1156 + len = c - dev_name; 1157 if (len > sizeof(data->hostname)) 1158 + return -ENAMETOOLONG; 1159 strncpy(data->hostname, dev_name, len); 1160 args.nfs_server.hostname = data->hostname; 1161 1162 c++; 1163 if (strlen(c) > NFS_MAXPATHLEN) 1164 + return -ENAMETOOLONG; 1165 args.nfs_server.export_path = c; 1166 1167 status = nfs_try_mount(&args, mntfh); 1168 if (status) 1169 + return status; 1170 1171 /* 1172 * Translate to nfs_mount_data, which nfs_fill_super ··· 1677 /* while calculating len, pretend ':' is '\0' */ 1678 len = c - dev_name; 1679 if (len > NFS4_MAXNAMLEN) 1680 + return -ENAMETOOLONG; 1681 *hostname = kzalloc(len, GFP_KERNEL); 1682 if (*hostname == NULL) 1683 return -ENOMEM; ··· 1686 c++; /* step over the ':' */ 1687 len = strlen(c); 1688 if (len > NFS4_MAXPATHLEN) 1689 + return -ENAMETOOLONG; 1690 *mntpath = kzalloc(len + 1, GFP_KERNEL); 1691 if (*mntpath == NULL) 1692 return -ENOMEM;
+44
fs/nfs/write.c
··· 1396 return ret; 1397 } 1398 1399 int nfs_wb_page_priority(struct inode *inode, struct page *page, int how) 1400 { 1401 loff_t range_start = page_offset(page);
··· 1396 return ret; 1397 } 1398 1399 + int nfs_wb_page_cancel(struct inode *inode, struct page *page) 1400 + { 1401 + struct nfs_page *req; 1402 + loff_t range_start = page_offset(page); 1403 + loff_t range_end = range_start + (loff_t)(PAGE_CACHE_SIZE - 1); 1404 + struct writeback_control wbc = { 1405 + .bdi = page->mapping->backing_dev_info, 1406 + .sync_mode = WB_SYNC_ALL, 1407 + .nr_to_write = LONG_MAX, 1408 + .range_start = range_start, 1409 + .range_end = range_end, 1410 + }; 1411 + int ret = 0; 1412 + 1413 + BUG_ON(!PageLocked(page)); 1414 + for (;;) { 1415 + req = nfs_page_find_request(page); 1416 + if (req == NULL) 1417 + goto out; 1418 + if (test_bit(PG_NEED_COMMIT, &req->wb_flags)) { 1419 + nfs_release_request(req); 1420 + break; 1421 + } 1422 + if (nfs_lock_request_dontget(req)) { 1423 + nfs_inode_remove_request(req); 1424 + /* 1425 + * In case nfs_inode_remove_request has marked the 1426 + * page as being dirty 1427 + */ 1428 + cancel_dirty_page(page, PAGE_CACHE_SIZE); 1429 + nfs_unlock_request(req); 1430 + break; 1431 + } 1432 + ret = nfs_wait_on_request(req); 1433 + if (ret < 0) 1434 + goto out; 1435 + } 1436 + if (!PagePrivate(page)) 1437 + return 0; 1438 + ret = nfs_sync_mapping_wait(page->mapping, &wbc, FLUSH_INVALIDATE); 1439 + out: 1440 + return ret; 1441 + } 1442 + 1443 int nfs_wb_page_priority(struct inode *inode, struct page *page, int how) 1444 { 1445 loff_t range_start = page_offset(page);
+1
include/linux/nfs_fs.h
··· 431 extern int nfs_wb_all(struct inode *inode); 432 extern int nfs_wb_page(struct inode *inode, struct page* page); 433 extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how); 434 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 435 extern int nfs_commit_inode(struct inode *, int); 436 extern struct nfs_write_data *nfs_commit_alloc(void);
··· 431 extern int nfs_wb_all(struct inode *inode); 432 extern int nfs_wb_page(struct inode *inode, struct page* page); 433 extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how); 434 + extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); 435 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 436 extern int nfs_commit_inode(struct inode *, int); 437 extern struct nfs_write_data *nfs_commit_alloc(void);