summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-04-06 09:17:24 -0400
committerDavid Howells <dhowells@redhat.com>2018-04-09 16:53:56 -0400
commit0c3a5ac28115f45ee1d56717d9a9526bc6d63b05 (patch)
tree803c5a579b7c4621e5bf784e562762e454197a9f /fs
parent5800db810a2308544a9e42686a2fc7f8682418ba (diff)
afs: Make it possible to get the data version in readpage
Store the data version number indicated by an FS.FetchData op into the read request structure so that it's accessible by the page reader. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/afs/flock.c2
-rw-r--r--fs/afs/fsclient.c83
-rw-r--r--fs/afs/inode.c8
-rw-r--r--fs/afs/internal.h8
-rw-r--r--fs/afs/security.c2
5 files changed, 59 insertions, 44 deletions
diff --git a/fs/afs/flock.c b/fs/afs/flock.c
index c40ba2fe3cbe..7a0e017070ec 100644
--- a/fs/afs/flock.c
+++ b/fs/afs/flock.c
@@ -613,7 +613,7 @@ static int afs_do_getlk(struct file *file, struct file_lock *fl)
613 posix_test_lock(file, fl); 613 posix_test_lock(file, fl);
614 if (fl->fl_type == F_UNLCK) { 614 if (fl->fl_type == F_UNLCK) {
615 /* no local locks; consult the server */ 615 /* no local locks; consult the server */
616 ret = afs_fetch_status(vnode, key); 616 ret = afs_fetch_status(vnode, key, false);
617 if (ret < 0) 617 if (ret < 0)
618 goto error; 618 goto error;
619 619
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c
index 90aa3eb2c893..015bbbba0858 100644
--- a/fs/afs/fsclient.c
+++ b/fs/afs/fsclient.c
@@ -69,9 +69,9 @@ static void xdr_dump_bad(const __be32 *bp)
69static void xdr_decode_AFSFetchStatus(const __be32 **_bp, 69static void xdr_decode_AFSFetchStatus(const __be32 **_bp,
70 struct afs_file_status *status, 70 struct afs_file_status *status,
71 struct afs_vnode *vnode, 71 struct afs_vnode *vnode,
72 afs_dataversion_t *store_version) 72 const afs_dataversion_t *expected_version,
73 afs_dataversion_t *_version)
73{ 74{
74 afs_dataversion_t expected_version;
75 const __be32 *bp = *_bp; 75 const __be32 *bp = *_bp;
76 umode_t mode; 76 umode_t mode;
77 u64 data_version, size; 77 u64 data_version, size;
@@ -136,6 +136,8 @@ static void xdr_decode_AFSFetchStatus(const __be32 **_bp,
136 changed |= true; 136 changed |= true;
137 } 137 }
138 status->mode &= S_IALLUGO; 138 status->mode &= S_IALLUGO;
139 if (_version)
140 *_version = data_version;
139 141
140 _debug("vnode time %lx, %lx", 142 _debug("vnode time %lx, %lx",
141 status->mtime_client, status->mtime_server); 143 status->mtime_client, status->mtime_server);
@@ -162,12 +164,8 @@ static void xdr_decode_AFSFetchStatus(const __be32 **_bp,
162 inode_set_iversion_raw(&vnode->vfs_inode, data_version); 164 inode_set_iversion_raw(&vnode->vfs_inode, data_version);
163 } 165 }
164 166
165 expected_version = status->data_version; 167 status->data_version = data_version;
166 if (store_version) 168 if (expected_version && *expected_version != data_version) {
167 expected_version = *store_version;
168
169 if (expected_version != data_version) {
170 status->data_version = data_version;
171 if (vnode && !test_bit(AFS_VNODE_UNSET, &vnode->flags)) { 169 if (vnode && !test_bit(AFS_VNODE_UNSET, &vnode->flags)) {
172 _debug("vnode modified %llx on {%x:%u}", 170 _debug("vnode modified %llx on {%x:%u}",
173 (unsigned long long) data_version, 171 (unsigned long long) data_version,
@@ -175,8 +173,6 @@ static void xdr_decode_AFSFetchStatus(const __be32 **_bp,
175 set_bit(AFS_VNODE_DIR_MODIFIED, &vnode->flags); 173 set_bit(AFS_VNODE_DIR_MODIFIED, &vnode->flags);
176 set_bit(AFS_VNODE_ZAP_DATA, &vnode->flags); 174 set_bit(AFS_VNODE_ZAP_DATA, &vnode->flags);
177 } 175 }
178 } else if (store_version) {
179 status->data_version = data_version;
180 } 176 }
181 177
182out: 178out:
@@ -323,7 +319,8 @@ static int afs_deliver_fs_fetch_status_vnode(struct afs_call *call)
323 319
324 /* unmarshall the reply once we've received all of it */ 320 /* unmarshall the reply once we've received all of it */
325 bp = call->buffer; 321 bp = call->buffer;
326 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode, NULL); 322 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode,
323 &call->expected_version, NULL);
327 xdr_decode_AFSCallBack(call, vnode, &bp); 324 xdr_decode_AFSCallBack(call, vnode, &bp);
328 if (call->reply[1]) 325 if (call->reply[1])
329 xdr_decode_AFSVolSync(&bp, call->reply[1]); 326 xdr_decode_AFSVolSync(&bp, call->reply[1]);
@@ -345,7 +342,8 @@ static const struct afs_call_type afs_RXFSFetchStatus_vnode = {
345/* 342/*
346 * fetch the status information for a file 343 * fetch the status information for a file
347 */ 344 */
348int afs_fs_fetch_file_status(struct afs_fs_cursor *fc, struct afs_volsync *volsync) 345int afs_fs_fetch_file_status(struct afs_fs_cursor *fc, struct afs_volsync *volsync,
346 bool new_inode)
349{ 347{
350 struct afs_vnode *vnode = fc->vnode; 348 struct afs_vnode *vnode = fc->vnode;
351 struct afs_call *call; 349 struct afs_call *call;
@@ -365,6 +363,7 @@ int afs_fs_fetch_file_status(struct afs_fs_cursor *fc, struct afs_volsync *volsy
365 call->key = fc->key; 363 call->key = fc->key;
366 call->reply[0] = vnode; 364 call->reply[0] = vnode;
367 call->reply[1] = volsync; 365 call->reply[1] = volsync;
366 call->expected_version = new_inode ? 1 : vnode->status.data_version;
368 367
369 /* marshall the parameters */ 368 /* marshall the parameters */
370 bp = call->request; 369 bp = call->request;
@@ -500,7 +499,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
500 return ret; 499 return ret;
501 500
502 bp = call->buffer; 501 bp = call->buffer;
503 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode, NULL); 502 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode,
503 &vnode->status.data_version,
504 &req->new_version);
504 xdr_decode_AFSCallBack(call, vnode, &bp); 505 xdr_decode_AFSCallBack(call, vnode, &bp);
505 if (call->reply[1]) 506 if (call->reply[1])
506 xdr_decode_AFSVolSync(&bp, call->reply[1]); 507 xdr_decode_AFSVolSync(&bp, call->reply[1]);
@@ -570,6 +571,7 @@ static int afs_fs_fetch_data64(struct afs_fs_cursor *fc, struct afs_read *req)
570 call->reply[0] = vnode; 571 call->reply[0] = vnode;
571 call->reply[1] = NULL; /* volsync */ 572 call->reply[1] = NULL; /* volsync */
572 call->reply[2] = req; 573 call->reply[2] = req;
574 call->expected_version = vnode->status.data_version;
573 575
574 /* marshall the parameters */ 576 /* marshall the parameters */
575 bp = call->request; 577 bp = call->request;
@@ -614,6 +616,7 @@ int afs_fs_fetch_data(struct afs_fs_cursor *fc, struct afs_read *req)
614 call->reply[0] = vnode; 616 call->reply[0] = vnode;
615 call->reply[1] = NULL; /* volsync */ 617 call->reply[1] = NULL; /* volsync */
616 call->reply[2] = req; 618 call->reply[2] = req;
619 call->expected_version = vnode->status.data_version;
617 620
618 /* marshall the parameters */ 621 /* marshall the parameters */
619 bp = call->request; 622 bp = call->request;
@@ -649,8 +652,9 @@ static int afs_deliver_fs_create_vnode(struct afs_call *call)
649 /* unmarshall the reply once we've received all of it */ 652 /* unmarshall the reply once we've received all of it */
650 bp = call->buffer; 653 bp = call->buffer;
651 xdr_decode_AFSFid(&bp, call->reply[1]); 654 xdr_decode_AFSFid(&bp, call->reply[1]);
652 xdr_decode_AFSFetchStatus(&bp, call->reply[2], NULL, NULL); 655 xdr_decode_AFSFetchStatus(&bp, call->reply[2], NULL, NULL, NULL);
653 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode, NULL); 656 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode,
657 &call->expected_version, NULL);
654 xdr_decode_AFSCallBack_raw(&bp, call->reply[3]); 658 xdr_decode_AFSCallBack_raw(&bp, call->reply[3]);
655 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */ 659 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */
656 660
@@ -708,6 +712,7 @@ int afs_fs_create(struct afs_fs_cursor *fc,
708 call->reply[1] = newfid; 712 call->reply[1] = newfid;
709 call->reply[2] = newstatus; 713 call->reply[2] = newstatus;
710 call->reply[3] = newcb; 714 call->reply[3] = newcb;
715 call->expected_version = vnode->status.data_version;
711 716
712 /* marshall the parameters */ 717 /* marshall the parameters */
713 bp = call->request; 718 bp = call->request;
@@ -751,7 +756,8 @@ static int afs_deliver_fs_remove(struct afs_call *call)
751 756
752 /* unmarshall the reply once we've received all of it */ 757 /* unmarshall the reply once we've received all of it */
753 bp = call->buffer; 758 bp = call->buffer;
754 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode, NULL); 759 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode,
760 &call->expected_version, NULL);
755 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */ 761 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */
756 762
757 _leave(" = 0 [done]"); 763 _leave(" = 0 [done]");
@@ -800,6 +806,7 @@ int afs_fs_remove(struct afs_fs_cursor *fc, const char *name, bool isdir)
800 806
801 call->key = fc->key; 807 call->key = fc->key;
802 call->reply[0] = vnode; 808 call->reply[0] = vnode;
809 call->expected_version = vnode->status.data_version;
803 810
804 /* marshall the parameters */ 811 /* marshall the parameters */
805 bp = call->request; 812 bp = call->request;
@@ -837,8 +844,9 @@ static int afs_deliver_fs_link(struct afs_call *call)
837 844
838 /* unmarshall the reply once we've received all of it */ 845 /* unmarshall the reply once we've received all of it */
839 bp = call->buffer; 846 bp = call->buffer;
840 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode, NULL); 847 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode, NULL, NULL);
841 xdr_decode_AFSFetchStatus(&bp, &dvnode->status, dvnode, NULL); 848 xdr_decode_AFSFetchStatus(&bp, &dvnode->status, dvnode,
849 &call->expected_version, NULL);
842 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */ 850 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */
843 851
844 _leave(" = 0 [done]"); 852 _leave(" = 0 [done]");
@@ -880,6 +888,7 @@ int afs_fs_link(struct afs_fs_cursor *fc, struct afs_vnode *vnode,
880 call->key = fc->key; 888 call->key = fc->key;
881 call->reply[0] = dvnode; 889 call->reply[0] = dvnode;
882 call->reply[1] = vnode; 890 call->reply[1] = vnode;
891 call->expected_version = vnode->status.data_version;
883 892
884 /* marshall the parameters */ 893 /* marshall the parameters */
885 bp = call->request; 894 bp = call->request;
@@ -921,8 +930,9 @@ static int afs_deliver_fs_symlink(struct afs_call *call)
921 /* unmarshall the reply once we've received all of it */ 930 /* unmarshall the reply once we've received all of it */
922 bp = call->buffer; 931 bp = call->buffer;
923 xdr_decode_AFSFid(&bp, call->reply[1]); 932 xdr_decode_AFSFid(&bp, call->reply[1]);
924 xdr_decode_AFSFetchStatus(&bp, call->reply[2], NULL, NULL); 933 xdr_decode_AFSFetchStatus(&bp, call->reply[2], NULL, NULL, NULL);
925 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode, NULL); 934 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode,
935 &call->expected_version, NULL);
926 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */ 936 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */
927 937
928 _leave(" = 0 [done]"); 938 _leave(" = 0 [done]");
@@ -973,6 +983,7 @@ int afs_fs_symlink(struct afs_fs_cursor *fc,
973 call->reply[0] = vnode; 983 call->reply[0] = vnode;
974 call->reply[1] = newfid; 984 call->reply[1] = newfid;
975 call->reply[2] = newstatus; 985 call->reply[2] = newstatus;
986 call->expected_version = vnode->status.data_version;
976 987
977 /* marshall the parameters */ 988 /* marshall the parameters */
978 bp = call->request; 989 bp = call->request;
@@ -1023,10 +1034,11 @@ static int afs_deliver_fs_rename(struct afs_call *call)
1023 1034
1024 /* unmarshall the reply once we've received all of it */ 1035 /* unmarshall the reply once we've received all of it */
1025 bp = call->buffer; 1036 bp = call->buffer;
1026 xdr_decode_AFSFetchStatus(&bp, &orig_dvnode->status, orig_dvnode, NULL); 1037 xdr_decode_AFSFetchStatus(&bp, &orig_dvnode->status, orig_dvnode,
1038 &call->expected_version, NULL);
1027 if (new_dvnode != orig_dvnode) 1039 if (new_dvnode != orig_dvnode)
1028 xdr_decode_AFSFetchStatus(&bp, &new_dvnode->status, new_dvnode, 1040 xdr_decode_AFSFetchStatus(&bp, &new_dvnode->status, new_dvnode,
1029 NULL); 1041 &call->expected_version_2, NULL);
1030 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */ 1042 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */
1031 1043
1032 _leave(" = 0 [done]"); 1044 _leave(" = 0 [done]");
@@ -1077,6 +1089,8 @@ int afs_fs_rename(struct afs_fs_cursor *fc,
1077 call->key = fc->key; 1089 call->key = fc->key;
1078 call->reply[0] = orig_dvnode; 1090 call->reply[0] = orig_dvnode;
1079 call->reply[1] = new_dvnode; 1091 call->reply[1] = new_dvnode;
1092 call->expected_version = orig_dvnode->status.data_version;
1093 call->expected_version_2 = new_dvnode->status.data_version;
1080 1094
1081 /* marshall the parameters */ 1095 /* marshall the parameters */
1082 bp = call->request; 1096 bp = call->request;
@@ -1126,7 +1140,7 @@ static int afs_deliver_fs_store_data(struct afs_call *call)
1126 /* unmarshall the reply once we've received all of it */ 1140 /* unmarshall the reply once we've received all of it */
1127 bp = call->buffer; 1141 bp = call->buffer;
1128 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode, 1142 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode,
1129 &call->store_version); 1143 &call->expected_version, NULL);
1130 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */ 1144 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */
1131 1145
1132 afs_pages_written_back(vnode, call); 1146 afs_pages_written_back(vnode, call);
@@ -1183,7 +1197,7 @@ static int afs_fs_store_data64(struct afs_fs_cursor *fc,
1183 call->first_offset = offset; 1197 call->first_offset = offset;
1184 call->last_to = to; 1198 call->last_to = to;
1185 call->send_pages = true; 1199 call->send_pages = true;
1186 call->store_version = vnode->status.data_version + 1; 1200 call->expected_version = vnode->status.data_version + 1;
1187 1201
1188 /* marshall the parameters */ 1202 /* marshall the parameters */
1189 bp = call->request; 1203 bp = call->request;
@@ -1258,7 +1272,7 @@ int afs_fs_store_data(struct afs_fs_cursor *fc, struct address_space *mapping,
1258 call->first_offset = offset; 1272 call->first_offset = offset;
1259 call->last_to = to; 1273 call->last_to = to;
1260 call->send_pages = true; 1274 call->send_pages = true;
1261 call->store_version = vnode->status.data_version + 1; 1275 call->expected_version = vnode->status.data_version + 1;
1262 1276
1263 /* marshall the parameters */ 1277 /* marshall the parameters */
1264 bp = call->request; 1278 bp = call->request;
@@ -1288,7 +1302,6 @@ int afs_fs_store_data(struct afs_fs_cursor *fc, struct address_space *mapping,
1288 */ 1302 */
1289static int afs_deliver_fs_store_status(struct afs_call *call) 1303static int afs_deliver_fs_store_status(struct afs_call *call)
1290{ 1304{
1291 afs_dataversion_t *store_version;
1292 struct afs_vnode *vnode = call->reply[0]; 1305 struct afs_vnode *vnode = call->reply[0];
1293 const __be32 *bp; 1306 const __be32 *bp;
1294 int ret; 1307 int ret;
@@ -1300,12 +1313,9 @@ static int afs_deliver_fs_store_status(struct afs_call *call)
1300 return ret; 1313 return ret;
1301 1314
1302 /* unmarshall the reply once we've received all of it */ 1315 /* unmarshall the reply once we've received all of it */
1303 store_version = NULL;
1304 if (call->operation_ID == FSSTOREDATA)
1305 store_version = &call->store_version;
1306
1307 bp = call->buffer; 1316 bp = call->buffer;
1308 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode, store_version); 1317 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode,
1318 &call->expected_version, NULL);
1309 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */ 1319 /* xdr_decode_AFSVolSync(&bp, call->reply[X]); */
1310 1320
1311 _leave(" = 0 [done]"); 1321 _leave(" = 0 [done]");
@@ -1360,7 +1370,7 @@ static int afs_fs_setattr_size64(struct afs_fs_cursor *fc, struct iattr *attr)
1360 1370
1361 call->key = fc->key; 1371 call->key = fc->key;
1362 call->reply[0] = vnode; 1372 call->reply[0] = vnode;
1363 call->store_version = vnode->status.data_version + 1; 1373 call->expected_version = vnode->status.data_version + 1;
1364 1374
1365 /* marshall the parameters */ 1375 /* marshall the parameters */
1366 bp = call->request; 1376 bp = call->request;
@@ -1409,7 +1419,7 @@ static int afs_fs_setattr_size(struct afs_fs_cursor *fc, struct iattr *attr)
1409 1419
1410 call->key = fc->key; 1420 call->key = fc->key;
1411 call->reply[0] = vnode; 1421 call->reply[0] = vnode;
1412 call->store_version = vnode->status.data_version + 1; 1422 call->expected_version = vnode->status.data_version + 1;
1413 1423
1414 /* marshall the parameters */ 1424 /* marshall the parameters */
1415 bp = call->request; 1425 bp = call->request;
@@ -1454,6 +1464,7 @@ int afs_fs_setattr(struct afs_fs_cursor *fc, struct iattr *attr)
1454 1464
1455 call->key = fc->key; 1465 call->key = fc->key;
1456 call->reply[0] = vnode; 1466 call->reply[0] = vnode;
1467 call->expected_version = vnode->status.data_version;
1457 1468
1458 /* marshall the parameters */ 1469 /* marshall the parameters */
1459 bp = call->request; 1470 bp = call->request;
@@ -2004,7 +2015,8 @@ static int afs_deliver_fs_fetch_status(struct afs_call *call)
2004 2015
2005 /* unmarshall the reply once we've received all of it */ 2016 /* unmarshall the reply once we've received all of it */
2006 bp = call->buffer; 2017 bp = call->buffer;
2007 xdr_decode_AFSFetchStatus(&bp, status, vnode, NULL); 2018 xdr_decode_AFSFetchStatus(&bp, status, vnode,
2019 &call->expected_version, NULL);
2008 callback[call->count].version = ntohl(bp[0]); 2020 callback[call->count].version = ntohl(bp[0]);
2009 callback[call->count].expiry = ntohl(bp[1]); 2021 callback[call->count].expiry = ntohl(bp[1]);
2010 callback[call->count].type = ntohl(bp[2]); 2022 callback[call->count].type = ntohl(bp[2]);
@@ -2056,6 +2068,7 @@ int afs_fs_fetch_status(struct afs_fs_cursor *fc,
2056 call->reply[1] = status; 2068 call->reply[1] = status;
2057 call->reply[2] = callback; 2069 call->reply[2] = callback;
2058 call->reply[3] = volsync; 2070 call->reply[3] = volsync;
2071 call->expected_version = 1; /* vnode->status.data_version */
2059 2072
2060 /* marshall the parameters */ 2073 /* marshall the parameters */
2061 bp = call->request; 2074 bp = call->request;
@@ -2116,7 +2129,7 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
2116 statuses = call->reply[1]; 2129 statuses = call->reply[1];
2117 xdr_decode_AFSFetchStatus(&bp, &statuses[call->count], 2130 xdr_decode_AFSFetchStatus(&bp, &statuses[call->count],
2118 call->count == 0 ? vnode : NULL, 2131 call->count == 0 ? vnode : NULL,
2119 NULL); 2132 NULL, NULL);
2120 2133
2121 call->count++; 2134 call->count++;
2122 if (call->count < call->count2) 2135 if (call->count < call->count2)
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index bcaff40b664d..488abd78dc26 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -105,7 +105,7 @@ static int afs_inode_map_status(struct afs_vnode *vnode, struct key *key)
105/* 105/*
106 * Fetch file status from the volume. 106 * Fetch file status from the volume.
107 */ 107 */
108int afs_fetch_status(struct afs_vnode *vnode, struct key *key) 108int afs_fetch_status(struct afs_vnode *vnode, struct key *key, bool new_inode)
109{ 109{
110 struct afs_fs_cursor fc; 110 struct afs_fs_cursor fc;
111 int ret; 111 int ret;
@@ -119,7 +119,7 @@ int afs_fetch_status(struct afs_vnode *vnode, struct key *key)
119 if (afs_begin_vnode_operation(&fc, vnode, key)) { 119 if (afs_begin_vnode_operation(&fc, vnode, key)) {
120 while (afs_select_fileserver(&fc)) { 120 while (afs_select_fileserver(&fc)) {
121 fc.cb_break = vnode->cb_break + vnode->cb_s_break; 121 fc.cb_break = vnode->cb_break + vnode->cb_s_break;
122 afs_fs_fetch_file_status(&fc, NULL); 122 afs_fs_fetch_file_status(&fc, NULL, new_inode);
123 } 123 }
124 124
125 afs_check_for_remote_deletion(&fc, fc.vnode); 125 afs_check_for_remote_deletion(&fc, fc.vnode);
@@ -307,7 +307,7 @@ struct inode *afs_iget(struct super_block *sb, struct key *key,
307 307
308 if (!status) { 308 if (!status) {
309 /* it's a remotely extant inode */ 309 /* it's a remotely extant inode */
310 ret = afs_fetch_status(vnode, key); 310 ret = afs_fetch_status(vnode, key, true);
311 if (ret < 0) 311 if (ret < 0)
312 goto bad_inode; 312 goto bad_inode;
313 } else { 313 } else {
@@ -432,7 +432,7 @@ int afs_validate(struct afs_vnode *vnode, struct key *key)
432 * access */ 432 * access */
433 if (!test_bit(AFS_VNODE_CB_PROMISED, &vnode->flags)) { 433 if (!test_bit(AFS_VNODE_CB_PROMISED, &vnode->flags)) {
434 _debug("not promised"); 434 _debug("not promised");
435 ret = afs_fetch_status(vnode, key); 435 ret = afs_fetch_status(vnode, key, false);
436 if (ret < 0) { 436 if (ret < 0) {
437 if (ret == -ENOENT) { 437 if (ret == -ENOENT) {
438 set_bit(AFS_VNODE_DELETED, &vnode->flags); 438 set_bit(AFS_VNODE_DELETED, &vnode->flags);
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index ca65f121d2cc..6b72807c40af 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -122,7 +122,8 @@ struct afs_call {
122 u32 operation_ID; /* operation ID for an incoming call */ 122 u32 operation_ID; /* operation ID for an incoming call */
123 u32 count; /* count for use in unmarshalling */ 123 u32 count; /* count for use in unmarshalling */
124 __be32 tmp; /* place to extract temporary data */ 124 __be32 tmp; /* place to extract temporary data */
125 afs_dataversion_t store_version; /* updated version expected from store */ 125 afs_dataversion_t expected_version; /* Updated version expected from store */
126 afs_dataversion_t expected_version_2; /* 2nd updated version expected from store */
126}; 127};
127 128
128struct afs_call_type { 129struct afs_call_type {
@@ -173,6 +174,7 @@ struct afs_read {
173 loff_t len; /* How much we're asking for */ 174 loff_t len; /* How much we're asking for */
174 loff_t actual_len; /* How much we're actually getting */ 175 loff_t actual_len; /* How much we're actually getting */
175 loff_t remain; /* Amount remaining */ 176 loff_t remain; /* Amount remaining */
177 afs_dataversion_t new_version; /* Version number returned by server */
176 atomic_t usage; 178 atomic_t usage;
177 unsigned int index; /* Which page we're reading into */ 179 unsigned int index; /* Which page we're reading into */
178 unsigned int nr_pages; 180 unsigned int nr_pages;
@@ -702,7 +704,7 @@ extern int afs_flock(struct file *, int, struct file_lock *);
702/* 704/*
703 * fsclient.c 705 * fsclient.c
704 */ 706 */
705extern int afs_fs_fetch_file_status(struct afs_fs_cursor *, struct afs_volsync *); 707extern int afs_fs_fetch_file_status(struct afs_fs_cursor *, struct afs_volsync *, bool);
706extern int afs_fs_give_up_callbacks(struct afs_net *, struct afs_server *); 708extern int afs_fs_give_up_callbacks(struct afs_net *, struct afs_server *);
707extern int afs_fs_fetch_data(struct afs_fs_cursor *, struct afs_read *); 709extern int afs_fs_fetch_data(struct afs_fs_cursor *, struct afs_read *);
708extern int afs_fs_create(struct afs_fs_cursor *, const char *, umode_t, 710extern int afs_fs_create(struct afs_fs_cursor *, const char *, umode_t,
@@ -735,7 +737,7 @@ extern int afs_fs_fetch_status(struct afs_fs_cursor *, struct afs_net *,
735/* 737/*
736 * inode.c 738 * inode.c
737 */ 739 */
738extern int afs_fetch_status(struct afs_vnode *, struct key *); 740extern int afs_fetch_status(struct afs_vnode *, struct key *, bool);
739extern int afs_iget5_test(struct inode *, void *); 741extern int afs_iget5_test(struct inode *, void *);
740extern struct inode *afs_iget_pseudo_dir(struct super_block *, bool); 742extern struct inode *afs_iget_pseudo_dir(struct super_block *, bool);
741extern struct inode *afs_iget(struct super_block *, struct key *, 743extern struct inode *afs_iget(struct super_block *, struct key *,
diff --git a/fs/afs/security.c b/fs/afs/security.c
index bd82c5bf4a6a..cea2fff313dc 100644
--- a/fs/afs/security.c
+++ b/fs/afs/security.c
@@ -322,7 +322,7 @@ int afs_check_permit(struct afs_vnode *vnode, struct key *key,
322 */ 322 */
323 _debug("no valid permit"); 323 _debug("no valid permit");
324 324
325 ret = afs_fetch_status(vnode, key); 325 ret = afs_fetch_status(vnode, key, false);
326 if (ret < 0) { 326 if (ret < 0) {
327 *_access = 0; 327 *_access = 0;
328 _leave(" = %d", ret); 328 _leave(" = %d", ret);