aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/file.c2
-rw-r--r--fs/nfs/namespace.c2
-rw-r--r--fs/nfs/nfs4proc.c4
-rw-r--r--fs/nfs/super.c20
-rw-r--r--fs/nfs/write.c44
5 files changed, 58 insertions, 14 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index c87dc713b5d7..579cf8a7d4a7 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -316,7 +316,7 @@ static void nfs_invalidate_page(struct page *page, unsigned long offset)
316 if (offset != 0) 316 if (offset != 0)
317 return; 317 return;
318 /* Cancel any unstarted writes on this page */ 318 /* Cancel any unstarted writes on this page */
319 nfs_wb_page_priority(page->mapping->host, page, FLUSH_INVALIDATE); 319 nfs_wb_page_cancel(page->mapping->host, page);
320} 320}
321 321
322static int nfs_release_page(struct page *page, gfp_t gfp) 322static int nfs_release_page(struct page *page, gfp_t gfp)
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index aea76d0e5fbd..acfc56f9edc0 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -176,7 +176,7 @@ static void nfs_expire_automounts(struct work_struct *work)
176void nfs_release_automount_timer(void) 176void nfs_release_automount_timer(void)
177{ 177{
178 if (list_empty(&nfs_automount_list)) 178 if (list_empty(&nfs_automount_list))
179 cancel_delayed_work_sync(&nfs_automount_task); 179 cancel_delayed_work(&nfs_automount_task);
180} 180}
181 181
182/* 182/*
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 62b3ae280310..4b90e17555a9 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -646,7 +646,7 @@ static int _nfs4_do_open_reclaim(struct nfs_open_context *ctx, struct nfs4_state
646 rcu_read_lock(); 646 rcu_read_lock();
647 delegation = rcu_dereference(NFS_I(state->inode)->delegation); 647 delegation = rcu_dereference(NFS_I(state->inode)->delegation);
648 if (delegation != NULL && (delegation->flags & NFS_DELEGATION_NEED_RECLAIM) != 0) 648 if (delegation != NULL && (delegation->flags & NFS_DELEGATION_NEED_RECLAIM) != 0)
649 delegation_type = delegation->flags; 649 delegation_type = delegation->type;
650 rcu_read_unlock(); 650 rcu_read_unlock();
651 opendata->o_arg.u.delegation_type = delegation_type; 651 opendata->o_arg.u.delegation_type = delegation_type;
652 status = nfs4_open_recover(opendata, state); 652 status = nfs4_open_recover(opendata, state);
@@ -1434,7 +1434,7 @@ nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
1434 } 1434 }
1435 res = d_add_unique(dentry, igrab(state->inode)); 1435 res = d_add_unique(dentry, igrab(state->inode));
1436 if (res != NULL) 1436 if (res != NULL)
1437 dentry = res; 1437 path.dentry = res;
1438 nfs4_intent_set_file(nd, &path, state); 1438 nfs4_intent_set_file(nd, &path, state);
1439 return res; 1439 return res;
1440} 1440}
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 46139003ea0c..8ed593766f16 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -911,13 +911,13 @@ static int nfs_parse_mount_options(char *raw,
911 kfree(string); 911 kfree(string);
912 912
913 switch (token) { 913 switch (token) {
914 case Opt_udp: 914 case Opt_xprt_udp:
915 mnt->flags &= ~NFS_MOUNT_TCP; 915 mnt->flags &= ~NFS_MOUNT_TCP;
916 mnt->nfs_server.protocol = IPPROTO_UDP; 916 mnt->nfs_server.protocol = IPPROTO_UDP;
917 mnt->timeo = 7; 917 mnt->timeo = 7;
918 mnt->retrans = 5; 918 mnt->retrans = 5;
919 break; 919 break;
920 case Opt_tcp: 920 case Opt_xprt_tcp:
921 mnt->flags |= NFS_MOUNT_TCP; 921 mnt->flags |= NFS_MOUNT_TCP;
922 mnt->nfs_server.protocol = IPPROTO_TCP; 922 mnt->nfs_server.protocol = IPPROTO_TCP;
923 mnt->timeo = 600; 923 mnt->timeo = 600;
@@ -936,10 +936,10 @@ static int nfs_parse_mount_options(char *raw,
936 kfree(string); 936 kfree(string);
937 937
938 switch (token) { 938 switch (token) {
939 case Opt_udp: 939 case Opt_xprt_udp:
940 mnt->mount_server.protocol = IPPROTO_UDP; 940 mnt->mount_server.protocol = IPPROTO_UDP;
941 break; 941 break;
942 case Opt_tcp: 942 case Opt_xprt_tcp:
943 mnt->mount_server.protocol = IPPROTO_TCP; 943 mnt->mount_server.protocol = IPPROTO_TCP;
944 break; 944 break;
945 default: 945 default:
@@ -1153,20 +1153,20 @@ static int nfs_validate_mount_data(struct nfs_mount_data **options,
1153 c = strchr(dev_name, ':'); 1153 c = strchr(dev_name, ':');
1154 if (c == NULL) 1154 if (c == NULL)
1155 return -EINVAL; 1155 return -EINVAL;
1156 len = c - dev_name - 1; 1156 len = c - dev_name;
1157 if (len > sizeof(data->hostname)) 1157 if (len > sizeof(data->hostname))
1158 return -EINVAL; 1158 return -ENAMETOOLONG;
1159 strncpy(data->hostname, dev_name, len); 1159 strncpy(data->hostname, dev_name, len);
1160 args.nfs_server.hostname = data->hostname; 1160 args.nfs_server.hostname = data->hostname;
1161 1161
1162 c++; 1162 c++;
1163 if (strlen(c) > NFS_MAXPATHLEN) 1163 if (strlen(c) > NFS_MAXPATHLEN)
1164 return -EINVAL; 1164 return -ENAMETOOLONG;
1165 args.nfs_server.export_path = c; 1165 args.nfs_server.export_path = c;
1166 1166
1167 status = nfs_try_mount(&args, mntfh); 1167 status = nfs_try_mount(&args, mntfh);
1168 if (status) 1168 if (status)
1169 return -EINVAL; 1169 return status;
1170 1170
1171 /* 1171 /*
1172 * Translate to nfs_mount_data, which nfs_fill_super 1172 * Translate to nfs_mount_data, which nfs_fill_super
@@ -1677,7 +1677,7 @@ static int nfs4_validate_mount_data(struct nfs4_mount_data **options,
1677 /* while calculating len, pretend ':' is '\0' */ 1677 /* while calculating len, pretend ':' is '\0' */
1678 len = c - dev_name; 1678 len = c - dev_name;
1679 if (len > NFS4_MAXNAMLEN) 1679 if (len > NFS4_MAXNAMLEN)
1680 return -EINVAL; 1680 return -ENAMETOOLONG;
1681 *hostname = kzalloc(len, GFP_KERNEL); 1681 *hostname = kzalloc(len, GFP_KERNEL);
1682 if (*hostname == NULL) 1682 if (*hostname == NULL)
1683 return -ENOMEM; 1683 return -ENOMEM;
@@ -1686,7 +1686,7 @@ static int nfs4_validate_mount_data(struct nfs4_mount_data **options,
1686 c++; /* step over the ':' */ 1686 c++; /* step over the ':' */
1687 len = strlen(c); 1687 len = strlen(c);
1688 if (len > NFS4_MAXPATHLEN) 1688 if (len > NFS4_MAXPATHLEN)
1689 return -EINVAL; 1689 return -ENAMETOOLONG;
1690 *mntpath = kzalloc(len + 1, GFP_KERNEL); 1690 *mntpath = kzalloc(len + 1, GFP_KERNEL);
1691 if (*mntpath == NULL) 1691 if (*mntpath == NULL)
1692 return -ENOMEM; 1692 return -ENOMEM;
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index ef97e0c0f5b1..0d7a77cc394b 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1396,6 +1396,50 @@ out:
1396 return ret; 1396 return ret;
1397} 1397}
1398 1398
1399int 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);
1439out:
1440 return ret;
1441}
1442
1399int nfs_wb_page_priority(struct inode *inode, struct page *page, int how) 1443int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
1400{ 1444{
1401 loff_t range_start = page_offset(page); 1445 loff_t range_start = page_offset(page);