History

afs: Use ITER_XARRAY for writing

Use a single ITER_XARRAY iterator to describe the portion of a file to be transmitted to the server rather than generating a series of small ITER_BVEC iterators on the fly. This will make it easier to implement AIO in afs. In theory we could maybe use one giant ITER_BVEC, but that means potentially allocating a huge array of bio_vec structs (max 256 per page) when in fact the pagecache already has a structure listing all the relevant pages (radix_tree/xarray) that can be walked over.

David Howells committed 6 years ago

Commit bd80d8a1 parent c4508466 files · +126 −218Browse files

Unified · Split

6 files
  1. fs/afs/fsclient.c +20 −30
  2. fs/afs/internal.h +8 −7
  3. fs/afs/rxrpc.c +15 −88
  4. fs/afs/write.c +57 −43
  5. fs/afs/yfsclient.c +7 −18
  6. include/trace/events/afs.h +19 −32
fs/afs/fsclient.c+20−30
@@ -1055,8 +1055,7 @@ static const struct afs_call_type afs_RXFSStoreData64 = { · 1054 unmodified lines
10551055 /*
10561056 * store a set of pages to a very large file
10571057 */
1058−static void afs_fs_store_data64(struct afs_operation *op,
1059− loff_t pos, loff_t size, loff_t i_size)
1058+static void afs_fs_store_data64(struct afs_operation *op)
10601059 {
10611060 struct afs_vnode_param *vp = &op->file[0];
10621061 struct afs_call *call;
@@ -1071,7 +1070,7 @@ static void afs_fs_store_data64(struct afs_operation *op, · 8 unmodified lines
10711070 if (!call)
10721071 return afs_op_nomem(op);
10731072
1074− call->send_pages = true;
1073+ call->write_iter = op->store.write_iter;
10751074
10761075 /* marshall the parameters */
10771076 bp = call->request;
@@ -1087,47 +1086,38 @@ static void afs_fs_store_data64(struct afs_operation *op, · 9 unmodified lines
10871086 *bp++ = 0; /* unix mode */
10881087 *bp++ = 0; /* segment size */
10891088
1090− *bp++ = htonl(upper_32_bits(pos));
1091− *bp++ = htonl(lower_32_bits(pos));
1092− *bp++ = htonl(upper_32_bits(size));
1093− *bp++ = htonl(lower_32_bits(size));
1094− *bp++ = htonl(upper_32_bits(i_size));
1095− *bp++ = htonl(lower_32_bits(i_size));
1089+ *bp++ = htonl(upper_32_bits(op->store.pos));
1090+ *bp++ = htonl(lower_32_bits(op->store.pos));
1091+ *bp++ = htonl(upper_32_bits(op->store.size));
1092+ *bp++ = htonl(lower_32_bits(op->store.size));
1093+ *bp++ = htonl(upper_32_bits(op->store.i_size));
1094+ *bp++ = htonl(lower_32_bits(op->store.i_size));
10961095
10971096 trace_afs_make_fs_call(call, &vp->fid);
10981097 afs_make_op_call(op, call, GFP_NOFS);
10991098 }
11001099
11011100 /*
1102− * store a set of pages
1101+ * Write data to a file on the server.
11031102 */
11041103 void afs_fs_store_data(struct afs_operation *op)
11051104 {
11061105 struct afs_vnode_param *vp = &op->file[0];
11071106 struct afs_call *call;
1108− loff_t size, pos, i_size;
11091107 __be32 *bp;
11101108
11111109 _enter(",%x,{%llx:%llu},,",
11121110 key_serial(op->key), vp->fid.vid, vp->fid.vnode);
11131111
1114− size = (loff_t)op->store.last_to - (loff_t)op->store.first_offset;
1115− if (op->store.first != op->store.last)
1116− size += (loff_t)(op->store.last - op->store.first) << PAGE_SHIFT;
1117− pos = (loff_t)op->store.first << PAGE_SHIFT;
1118− pos += op->store.first_offset;
1119−
1120− i_size = i_size_read(&vp->vnode->vfs_inode);
1121− if (pos + size > i_size)
1122− i_size = size + pos;
1123−
11241112 _debug("size %llx, at %llx, i_size %llx",
1125− (unsigned long long) size, (unsigned long long) pos,
1126− (unsigned long long) i_size);
1113+ (unsigned long long)op->store.size,
1114+ (unsigned long long)op->store.pos,
1115+ (unsigned long long)op->store.i_size);
11271116
1128− if (upper_32_bits(pos) || upper_32_bits(i_size) || upper_32_bits(size) ||
1129− upper_32_bits(pos + size))
1130− return afs_fs_store_data64(op, pos, size, i_size);
1117+ if (upper_32_bits(op->store.pos) ||
1118+ upper_32_bits(op->store.size) ||
1119+ upper_32_bits(op->store.i_size))
1120+ return afs_fs_store_data64(op);
11311121
11321122 call = afs_alloc_flat_call(op->net, &afs_RXFSStoreData,
11331123 (4 + 6 + 3) * 4,
@@ -1135,7 +1125,7 @@ void afs_fs_store_data(struct afs_operation *op) · 1 unmodified line
11351125 if (!call)
11361126 return afs_op_nomem(op);
11371127
1138− call->send_pages = true;
1128+ call->write_iter = op->store.write_iter;
11391129
11401130 /* marshall the parameters */
11411131 bp = call->request;
@@ -1151,9 +1141,9 @@ void afs_fs_store_data(struct afs_operation *op) · 9 unmodified lines
11511141 *bp++ = 0; /* unix mode */
11521142 *bp++ = 0; /* segment size */
11531143
1154− *bp++ = htonl(lower_32_bits(pos));
1155− *bp++ = htonl(lower_32_bits(size));
1156− *bp++ = htonl(lower_32_bits(i_size));
1144+ *bp++ = htonl(lower_32_bits(op->store.pos));
1145+ *bp++ = htonl(lower_32_bits(op->store.size));
1146+ *bp++ = htonl(lower_32_bits(op->store.i_size));
11571147
11581148 trace_afs_make_fs_call(call, &vp->fid);
11591149 afs_make_op_call(op, call, GFP_NOFS);
fs/afs/internal.h+8−7
@@ -107,6 +107,7 @@ struct afs_call { · 106 unmodified lines
107107 void *request; /* request data (first part) */
108108 size_t iov_len; /* Size of *iter to be used */
109109 struct iov_iter def_iter; /* Default buffer/data iterator */
110+ struct iov_iter *write_iter; /* Iterator defining write to be made */
110111 struct iov_iter *iter; /* Iterator currently in use */
111112 union { /* Convenience for ->def_iter */
112113 struct kvec kvec[1];
@@ -133,7 +134,6 @@ struct afs_call { · 20 unmodified lines
133134 unsigned char unmarshall; /* unmarshalling phase */
134135 unsigned char addr_ix; /* Address in ->alist */
135136 bool drop_ref; /* T if need to drop ref for incoming call */
136− bool send_pages; /* T if data from mapping should be sent */
137137 bool need_attention; /* T if RxRPC poked us */
138138 bool async; /* T if asynchronous */
139139 bool upgrade; /* T to request service upgrade */
@@ -811,12 +811,13 @@ struct afs_operation { · 671 unmodified lines
811811 afs_lock_type_t type;
812812 } lock;
813813 struct {
814− struct address_space *mapping; /* Pages being written from */
815− pgoff_t first; /* first page in mapping to deal with */
816− pgoff_t last; /* last page in mapping to deal with */
817− unsigned first_offset; /* offset into mapping[first] */
818− unsigned last_to; /* amount of mapping[last] */
819− bool laundering; /* Laundering page, PG_writeback not set */
814+ struct iov_iter *write_iter;
815+ loff_t pos;
816+ loff_t size;
817+ loff_t i_size;
818+ pgoff_t first; /* first page in mapping to deal with */
819+ pgoff_t last; /* last page in mapping to deal with */
820+ bool laundering; /* Laundering page, PG_writeback not set */
820821 } store;
821822 struct {
822823 struct iattr *attr;
fs/afs/rxrpc.c+15−88
@@ -271,40 +271,6 @@ void afs_flat_call_destructor(struct afs_call *call) · 270 unmodified lines
271271 call->buffer = NULL;
272272 }
273273
274−#define AFS_BVEC_MAX 8
275−
276−/*
277− * Load the given bvec with the next few pages.
278− */
279−static void afs_load_bvec(struct afs_call *call, struct msghdr *msg,
280− struct bio_vec *bv, pgoff_t first, pgoff_t last,
281− unsigned offset)
282−{
283− struct afs_operation *op = call->op;
284− struct page *pages[AFS_BVEC_MAX];
285− unsigned int nr, n, i, to, bytes = 0;
286−
287− nr = min_t(pgoff_t, last - first + 1, AFS_BVEC_MAX);
288− n = find_get_pages_contig(op->store.mapping, first, nr, pages);
289− ASSERTCMP(n, ==, nr);
290−
291− msg->msg_flags |= MSG_MORE;
292− for (i = 0; i < nr; i++) {
293− to = PAGE_SIZE;
294− if (first + i >= last) {
295− to = op->store.last_to;
296− msg->msg_flags &= ~MSG_MORE;
297− }
298− bv[i].bv_page = pages[i];
299− bv[i].bv_len = to - offset;
300− bv[i].bv_offset = offset;
301− bytes += to - offset;
302− offset = 0;
303− }
304−
305− iov_iter_bvec(&msg->msg_iter, WRITE, bv, nr, bytes);
306−}
307−
308274 /*
309275 * Advance the AFS call state when the RxRPC call ends the transmit phase.
310276 */
@@ -317,42 +283,6 @@ static void afs_notify_end_request_tx(struct sock *sock, · 6 unmodified lines
317283 afs_set_call_state(call, AFS_CALL_CL_REQUESTING, AFS_CALL_CL_AWAIT_REPLY);
318284 }
319285
320−/*
321− * attach the data from a bunch of pages on an inode to a call
322− */
323−static int afs_send_pages(struct afs_call *call, struct msghdr *msg)
324−{
325− struct afs_operation *op = call->op;
326− struct bio_vec bv[AFS_BVEC_MAX];
327− unsigned int bytes, nr, loop, offset;
328− pgoff_t first = op->store.first, last = op->store.last;
329− int ret;
330−
331− offset = op->store.first_offset;
332− op->store.first_offset = 0;
333−
334− do {
335− afs_load_bvec(call, msg, bv, first, last, offset);
336− trace_afs_send_pages(call, msg, first, last, offset);
337−
338− offset = 0;
339− bytes = msg->msg_iter.count;
340− nr = msg->msg_iter.nr_segs;
341−
342− ret = rxrpc_kernel_send_data(op->net->socket, call->rxcall, msg,
343− bytes, afs_notify_end_request_tx);
344− for (loop = 0; loop < nr; loop++)
345− put_page(bv[loop].bv_page);
346− if (ret < 0)
347− break;
348−
349− first += nr;
350− } while (first <= last);
351−
352− trace_afs_sent_pages(call, op->store.first, last, first, ret);
353− return ret;
354−}
355−
356286 /*
357287 * Initiate a call and synchronously queue up the parameters for dispatch. Any
358288 * error is stored into the call struct, which the caller must check for.
@@ -384,21 +314,8 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp) · 25 unmodified lines
384314 * after the initial fixed part.
385315 */
386316 tx_total_len = call->request_size;
387− if (call->send_pages) {
388− struct afs_operation *op = call->op;
389−
390− if (op->store.last == op->store.first) {
391− tx_total_len += op->store.last_to - op->store.first_offset;
392− } else {
393− /* It looks mathematically like you should be able to
394− * combine the following lines with the ones above, but
395− * unsigned arithmetic is fun when it wraps...
396− */
397− tx_total_len += PAGE_SIZE - op->store.first_offset;
398− tx_total_len += op->store.last_to;
399− tx_total_len += (op->store.last - op->store.first - 1) * PAGE_SIZE;
400− }
401− }
317+ if (call->write_iter)
318+ tx_total_len += iov_iter_count(call->write_iter);
402319
403320 /* If the call is going to be asynchronous, we need an extra ref for
404321 * the call to hold itself so the caller need not hang on to its ref.
@@ -440,7 +357,7 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp) · 35 unmodified lines
440357 iov_iter_kvec(&msg.msg_iter, WRITE, iov, 1, call->request_size);
441358 msg.msg_control = NULL;
442359 msg.msg_controllen = 0;
443− msg.msg_flags = MSG_WAITALL | (call->send_pages ? MSG_MORE : 0);
360+ msg.msg_flags = MSG_WAITALL | (call->write_iter ? MSG_MORE : 0);
444361
445362 ret = rxrpc_kernel_send_data(call->net->socket, rxcall,
446363 &msg, call->request_size,
@@ -448,8 +365,18 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp) · 1 unmodified line
448365 if (ret < 0)
449366 goto error_do_abort;
450367
451− if (call->send_pages) {
452− ret = afs_send_pages(call, &msg);
368+ if (call->write_iter) {
369+ msg.msg_iter = *call->write_iter;
370+ msg.msg_flags &= ~MSG_MORE;
371+ trace_afs_send_data(call, &msg);
372+
373+ ret = rxrpc_kernel_send_data(call->net->socket,
374+ call->rxcall, &msg,
375+ iov_iter_count(&msg.msg_iter),
376+ afs_notify_end_request_tx);
377+ *call->write_iter = msg.msg_iter;
378+
379+ trace_afs_sent_data(call, &msg, ret);
453380 if (ret < 0)
454381 goto error_do_abort;
455382 }
fs/afs/write.c+57−43
@@ -325,36 +325,27 @@ static void afs_redirty_pages(struct writeback_control *wbc, · 324 unmodified lines
325325 /*
326326 * completion of write to server
327327 */
328−static void afs_pages_written_back(struct afs_vnode *vnode,
329− pgoff_t first, pgoff_t last)
328+static void afs_pages_written_back(struct afs_vnode *vnode, pgoff_t start, pgoff_t last)
330329 {
331− struct pagevec pv;
332− unsigned count, loop;
330+ struct address_space *mapping = vnode->vfs_inode.i_mapping;
331+ struct page *page;
332+
333+ XA_STATE(xas, &mapping->i_pages, start);
333334
334335 _enter("{%llx:%llu},{%lx-%lx}",
335− vnode->fid.vid, vnode->fid.vnode, first, last);
336+ vnode->fid.vid, vnode->fid.vnode, start, last);
336337
337− pagevec_init(&pv);
338+ rcu_read_lock();
338339
339− do {
340− _debug("done %lx-%lx", first, last);
340+ xas_for_each(&xas, page, last) {
341+ ASSERT(PageWriteback(page));
341342
342− count = last - first + 1;
343− if (count > PAGEVEC_SIZE)
344− count = PAGEVEC_SIZE;
345− pv.nr = find_get_pages_contig(vnode->vfs_inode.i_mapping,
346− first, count, pv.pages);
347− ASSERTCMP(pv.nr, ==, count);
343+ detach_page_private(page);
344+ trace_afs_page_dirty(vnode, tracepoint_string("clear"), page);
345+ page_endio(page, true, 0);
346+ }
348347
349− for (loop = 0; loop < count; loop++) {
350− detach_page_private(pv.pages[loop]);
351− trace_afs_page_dirty(vnode, tracepoint_string("clear"),
352− pv.pages[loop]);
353− end_page_writeback(pv.pages[loop]);
354− }
355− first += count;
356− __pagevec_release(&pv);
357− } while (first <= last);
348+ rcu_read_unlock();
358349
359350 afs_prune_wb_keys(vnode);
360351 _leave("");
@@ -411,9 +402,7 @@ static void afs_store_data_success(struct afs_operation *op) · 50 unmodified lines
411402 if (!op->store.laundering)
412403 afs_pages_written_back(vnode, op->store.first, op->store.last);
413404 afs_stat_v(vnode, n_stores);
414− atomic_long_add((op->store.last * PAGE_SIZE + op->store.last_to) -
415− (op->store.first * PAGE_SIZE + op->store.first_offset),
416− &afs_v2net(vnode)->n_store_bytes);
405+ atomic_long_add(op->store.size, &afs_v2net(vnode)->n_store_bytes);
417406 }
418407 }
419408
@@ -426,21 +415,21 @@ static const struct afs_operation_ops afs_store_data_operation = { · 6 unmodified lines
426415 /*
427416 * write to a file
428417 */
429−static int afs_store_data(struct address_space *mapping,
430− pgoff_t first, pgoff_t last,
431− unsigned offset, unsigned to, bool laundering)
418+static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter,
419+ loff_t pos, pgoff_t first, pgoff_t last,
420+ bool laundering)
432421 {
433− struct afs_vnode *vnode = AFS_FS_I(mapping->host);
434422 struct afs_operation *op;
435423 struct afs_wb_key *wbk = NULL;
436− int ret;
424+ loff_t size = iov_iter_count(iter), i_size;
425+ int ret = -ENOKEY;
437426
438− _enter("%s{%llx:%llu.%u},%lx,%lx,%x,%x",
427+ _enter("%s{%llx:%llu.%u},%llx,%llx",
439428 vnode->volume->name,
440429 vnode->fid.vid,
441430 vnode->fid.vnode,
442431 vnode->fid.unique,
443− first, last, offset, to);
432+ size, pos);
444433
445434 ret = afs_get_writeback_key(vnode, &wbk);
446435 if (ret) {
@@ -454,13 +443,16 @@ static int afs_store_data(struct address_space *mapping, · 7 unmodified lines
454443 return -ENOMEM;
455444 }
456445
446+ i_size = i_size_read(&vnode->vfs_inode);
447+
457448 afs_op_set_vnode(op, 0, vnode);
458449 op->file[0].dv_delta = 1;
459− op->store.mapping = mapping;
450+ op->store.write_iter = iter;
451+ op->store.pos = pos;
460452 op->store.first = first;
461453 op->store.last = last;
462− op->store.first_offset = offset;
463− op->store.last_to = to;
454+ op->store.size = size;
455+ op->store.i_size = max(pos + size, i_size);
464456 op->store.laundering = laundering;
465457 op->mtime = vnode->vfs_inode.i_mtime;
466458 op->flags |= AFS_OPERATION_UNINTR;
@@ -503,11 +495,12 @@ static int afs_write_back_from_locked_page(struct address_space *mapping, · 36 unmodified lines
503495 pgoff_t final_page)
504496 {
505497 struct afs_vnode *vnode = AFS_FS_I(mapping->host);
498+ struct iov_iter iter;
506499 struct page *pages[8], *page;
507500 unsigned long count, priv;
508501 unsigned n, offset, to, f, t;
509502 pgoff_t start, first, last;
510− loff_t i_size, end;
503+ loff_t i_size, pos, end;
511504 int loop, ret;
512505
513506 _enter(",%lx", primary_page->index);
@@ -604,15 +597,28 @@ no_more: · 90 unmodified lines
604597
605598 first = primary_page->index;
606599 last = first + count - 1;
600+ _debug("write back %lx[%u..] to %lx[..%u]", first, offset, last, to);
607601
608− end = (loff_t)last * PAGE_SIZE + to;
609− i_size = i_size_read(&vnode->vfs_inode);
602+ pos = first;
603+ pos <<= PAGE_SHIFT;
604+ pos += offset;
605+ end = last;
606+ end <<= PAGE_SHIFT;
607+ end += to;
610608
611− _debug("write back %lx[%u..] to %lx[..%u]", first, offset, last, to);
609+ /* Trim the actual write down to the EOF */
610+ i_size = i_size_read(&vnode->vfs_inode);
612611 if (end > i_size)
613− to = i_size & ~PAGE_MASK;
612+ end = i_size;
613+
614+ if (pos < i_size) {
615+ iov_iter_xarray(&iter, WRITE, &mapping->i_pages, pos, end - pos);
616+ ret = afs_store_data(vnode, &iter, pos, first, last, false);
617+ } else {
618+ /* The dirty region was entirely beyond the EOF. */
619+ ret = 0;
620+ }
614621
615− ret = afs_store_data(mapping, first, last, offset, to, false);
616622 switch (ret) {
617623 case 0:
618624 ret = count;
@@ -912,6 +918,8 @@ int afs_launder_page(struct page *page) · 293 unmodified lines
912918 {
913919 struct address_space *mapping = page->mapping;
914920 struct afs_vnode *vnode = AFS_FS_I(mapping->host);
921+ struct iov_iter iter;
922+ struct bio_vec bv[1];
915923 unsigned long priv;
916924 unsigned int f, t;
917925 int ret = 0;
@@ -927,8 +935,14 @@ int afs_launder_page(struct page *page) · 9 unmodified lines
927935 t = afs_page_dirty_to(page, priv);
928936 }
929937
938+ bv[0].bv_page = page;
939+ bv[0].bv_offset = f;
940+ bv[0].bv_len = t - f;
941+ iov_iter_bvec(&iter, WRITE, bv, 1, bv[0].bv_len);
942+
930943 trace_afs_page_dirty(vnode, tracepoint_string("launder"), page);
931− ret = afs_store_data(mapping, page->index, page->index, t, f, true);
944+ ret = afs_store_data(vnode, &iter, (loff_t)page->index << PAGE_SHIFT,
945+ page->index, page->index, true);
932946 }
933947
934948 detach_page_private(page);
fs/afs/yfsclient.c+7−18
@@ -1078,25 +1078,15 @@ void yfs_fs_store_data(struct afs_operation *op) · 1077 unmodified lines
10781078 {
10791079 struct afs_vnode_param *vp = &op->file[0];
10801080 struct afs_call *call;
1081− loff_t size, pos, i_size;
10821081 __be32 *bp;
10831082
10841083 _enter(",%x,{%llx:%llu},,",
10851084 key_serial(op->key), vp->fid.vid, vp->fid.vnode);
10861085
1087− size = (loff_t)op->store.last_to - (loff_t)op->store.first_offset;
1088− if (op->store.first != op->store.last)
1089− size += (loff_t)(op->store.last - op->store.first) << PAGE_SHIFT;
1090− pos = (loff_t)op->store.first << PAGE_SHIFT;
1091− pos += op->store.first_offset;
1092−
1093− i_size = i_size_read(&vp->vnode->vfs_inode);
1094− if (pos + size > i_size)
1095− i_size = size + pos;
1096−
10971086 _debug("size %llx, at %llx, i_size %llx",
1098− (unsigned long long)size, (unsigned long long)pos,
1099− (unsigned long long)i_size);
1087+ (unsigned long long)op->store.size,
1088+ (unsigned long long)op->store.pos,
1089+ (unsigned long long)op->store.i_size);
11001090
11011091 call = afs_alloc_flat_call(op->net, &yfs_RXYFSStoreData64,
11021092 sizeof(__be32) +
@@ -1109,8 +1099,7 @@ void yfs_fs_store_data(struct afs_operation *op) · 6 unmodified lines
11091099 if (!call)
11101100 return afs_op_nomem(op);
11111101
1112− call->key = op->key;
1113− call->send_pages = true;
1102+ call->write_iter = op->store.write_iter;
11141103
11151104 /* marshall the parameters */
11161105 bp = call->request;
@@ -1118,9 +1107,9 @@ void yfs_fs_store_data(struct afs_operation *op) · 1 unmodified line
11181107 bp = xdr_encode_u32(bp, 0); /* RPC flags */
11191108 bp = xdr_encode_YFSFid(bp, &vp->fid);
11201109 bp = xdr_encode_YFSStoreStatus_mtime(bp, &op->mtime);
1121− bp = xdr_encode_u64(bp, pos);
1122− bp = xdr_encode_u64(bp, size);
1123− bp = xdr_encode_u64(bp, i_size);
1110+ bp = xdr_encode_u64(bp, op->store.pos);
1111+ bp = xdr_encode_u64(bp, op->store.size);
1112+ bp = xdr_encode_u64(bp, op->store.i_size);
11241113 yfs_check_req(call, bp);
11251114
11261115 trace_afs_make_fs_call(call, &vp->fid);
include/trace/events/afs.h+19−32
@@ -886,65 +886,52 @@ TRACE_EVENT(afs_call_done, · 885 unmodified lines
886886 __entry->rx_call)
887887 );
888888
889−TRACE_EVENT(afs_send_pages,
890− TP_PROTO(struct afs_call *call, struct msghdr *msg,
891− pgoff_t first, pgoff_t last, unsigned int offset),
889+TRACE_EVENT(afs_send_data,
890+ TP_PROTO(struct afs_call *call, struct msghdr *msg),
892891
893− TP_ARGS(call, msg, first, last, offset),
892+ TP_ARGS(call, msg),
894893
895894 TP_STRUCT__entry(
896895 __field(unsigned int, call )
897− __field(pgoff_t, first )
898− __field(pgoff_t, last )
899− __field(unsigned int, nr )
900− __field(unsigned int, bytes )
901− __field(unsigned int, offset )
902896 __field(unsigned int, flags )
897+ __field(loff_t, offset )
898+ __field(loff_t, count )
903899 ),
904900
905901 TP_fast_assign(
906902 __entry->call = call->debug_id;
907− __entry->first = first;
908− __entry->last = last;
909− __entry->nr = msg->msg_iter.nr_segs;
910− __entry->bytes = msg->msg_iter.count;
911− __entry->offset = offset;
912903 __entry->flags = msg->msg_flags;
904+ __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
905+ __entry->count = iov_iter_count(&msg->msg_iter);
913906 ),
914907
915− TP_printk(" c=%08x %lx-%lx-%lx b=%x o=%x f=%x",
916− __entry->call,
917− __entry->first, __entry->first + __entry->nr - 1, __entry->last,
918− __entry->bytes, __entry->offset,
908+ TP_printk(" c=%08x o=%llx n=%llx f=%x",
909+ __entry->call, __entry->offset, __entry->count,
919910 __entry->flags)
920911 );
921912
922−TRACE_EVENT(afs_sent_pages,
923− TP_PROTO(struct afs_call *call, pgoff_t first, pgoff_t last,
924− pgoff_t cursor, int ret),
913+TRACE_EVENT(afs_sent_data,
914+ TP_PROTO(struct afs_call *call, struct msghdr *msg, int ret),
925915
926− TP_ARGS(call, first, last, cursor, ret),
916+ TP_ARGS(call, msg, ret),
927917
928918 TP_STRUCT__entry(
929919 __field(unsigned int, call )
930− __field(pgoff_t, first )
931− __field(pgoff_t, last )
932− __field(pgoff_t, cursor )
933920 __field(int, ret )
921+ __field(loff_t, offset )
922+ __field(loff_t, count )
934923 ),
935924
936925 TP_fast_assign(
937926 __entry->call = call->debug_id;
938− __entry->first = first;
939− __entry->last = last;
940− __entry->cursor = cursor;
941927 __entry->ret = ret;
928+ __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
929+ __entry->count = iov_iter_count(&msg->msg_iter);
942930 ),
943931
944− TP_printk(" c=%08x %lx-%lx c=%lx r=%d",
945− __entry->call,
946− __entry->first, __entry->last,
947− __entry->cursor, __entry->ret)
932+ TP_printk(" c=%08x o=%llx n=%llx r=%x",
933+ __entry->call, __entry->offset, __entry->count,
934+ __entry->ret)
948935 );
949936
950937 TRACE_EVENT(afs_dir_check_failed,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t