|
@@ -1520,14 +1520,23 @@ pnfs_update_layout(struct inode *ino,
|
|
struct pnfs_layout_segment *lseg = NULL;
|
|
struct pnfs_layout_segment *lseg = NULL;
|
|
bool first;
|
|
bool first;
|
|
|
|
|
|
- if (!pnfs_enabled_sb(NFS_SERVER(ino)))
|
|
|
|
|
|
+ if (!pnfs_enabled_sb(NFS_SERVER(ino))) {
|
|
|
|
+ trace_pnfs_update_layout(ino, pos, count, iomode, lseg,
|
|
|
|
+ PNFS_UPDATE_LAYOUT_NO_PNFS);
|
|
goto out;
|
|
goto out;
|
|
|
|
+ }
|
|
|
|
|
|
- if (iomode == IOMODE_READ && i_size_read(ino) == 0)
|
|
|
|
|
|
+ if (iomode == IOMODE_READ && i_size_read(ino) == 0) {
|
|
|
|
+ trace_pnfs_update_layout(ino, pos, count, iomode, lseg,
|
|
|
|
+ PNFS_UPDATE_LAYOUT_RD_ZEROLEN);
|
|
goto out;
|
|
goto out;
|
|
|
|
+ }
|
|
|
|
|
|
- if (pnfs_within_mdsthreshold(ctx, ino, iomode))
|
|
|
|
|
|
+ if (pnfs_within_mdsthreshold(ctx, ino, iomode)) {
|
|
|
|
+ trace_pnfs_update_layout(ino, pos, count, iomode, lseg,
|
|
|
|
+ PNFS_UPDATE_LAYOUT_MDSTHRESH);
|
|
goto out;
|
|
goto out;
|
|
|
|
+ }
|
|
|
|
|
|
lookup_again:
|
|
lookup_again:
|
|
first = false;
|
|
first = false;
|
|
@@ -1535,19 +1544,26 @@ lookup_again:
|
|
lo = pnfs_find_alloc_layout(ino, ctx, gfp_flags);
|
|
lo = pnfs_find_alloc_layout(ino, ctx, gfp_flags);
|
|
if (lo == NULL) {
|
|
if (lo == NULL) {
|
|
spin_unlock(&ino->i_lock);
|
|
spin_unlock(&ino->i_lock);
|
|
|
|
+ trace_pnfs_update_layout(ino, pos, count, iomode, lseg,
|
|
|
|
+ PNFS_UPDATE_LAYOUT_NOMEM);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
/* Do we even need to bother with this? */
|
|
/* Do we even need to bother with this? */
|
|
if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
|
|
if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
|
|
|
|
+ trace_pnfs_update_layout(ino, pos, count, iomode, lseg,
|
|
|
|
+ PNFS_UPDATE_LAYOUT_BULK_RECALL);
|
|
dprintk("%s matches recall, use MDS\n", __func__);
|
|
dprintk("%s matches recall, use MDS\n", __func__);
|
|
goto out_unlock;
|
|
goto out_unlock;
|
|
}
|
|
}
|
|
|
|
|
|
/* if LAYOUTGET already failed once we don't try again */
|
|
/* if LAYOUTGET already failed once we don't try again */
|
|
if (pnfs_layout_io_test_failed(lo, iomode) &&
|
|
if (pnfs_layout_io_test_failed(lo, iomode) &&
|
|
- !pnfs_should_retry_layoutget(lo))
|
|
|
|
|
|
+ !pnfs_should_retry_layoutget(lo)) {
|
|
|
|
+ trace_pnfs_update_layout(ino, pos, count, iomode, lseg,
|
|
|
|
+ PNFS_UPDATE_LAYOUT_IO_TEST_FAIL);
|
|
goto out_unlock;
|
|
goto out_unlock;
|
|
|
|
+ }
|
|
|
|
|
|
first = list_empty(&lo->plh_segs);
|
|
first = list_empty(&lo->plh_segs);
|
|
if (first) {
|
|
if (first) {
|
|
@@ -1567,8 +1583,11 @@ lookup_again:
|
|
* already exists
|
|
* already exists
|
|
*/
|
|
*/
|
|
lseg = pnfs_find_lseg(lo, &arg);
|
|
lseg = pnfs_find_lseg(lo, &arg);
|
|
- if (lseg)
|
|
|
|
|
|
+ if (lseg) {
|
|
|
|
+ trace_pnfs_update_layout(ino, pos, count, iomode, lseg,
|
|
|
|
+ PNFS_UPDATE_LAYOUT_FOUND_CACHED);
|
|
goto out_unlock;
|
|
goto out_unlock;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -1585,11 +1604,16 @@ lookup_again:
|
|
dprintk("%s retrying\n", __func__);
|
|
dprintk("%s retrying\n", __func__);
|
|
goto lookup_again;
|
|
goto lookup_again;
|
|
}
|
|
}
|
|
|
|
+ trace_pnfs_update_layout(ino, pos, count, iomode, lseg,
|
|
|
|
+ PNFS_UPDATE_LAYOUT_RETURN);
|
|
goto out_put_layout_hdr;
|
|
goto out_put_layout_hdr;
|
|
}
|
|
}
|
|
|
|
|
|
- if (pnfs_layoutgets_blocked(lo))
|
|
|
|
|
|
+ if (pnfs_layoutgets_blocked(lo)) {
|
|
|
|
+ trace_pnfs_update_layout(ino, pos, count, iomode, lseg,
|
|
|
|
+ PNFS_UPDATE_LAYOUT_BLOCKED);
|
|
goto out_unlock;
|
|
goto out_unlock;
|
|
|
|
+ }
|
|
atomic_inc(&lo->plh_outstanding);
|
|
atomic_inc(&lo->plh_outstanding);
|
|
spin_unlock(&ino->i_lock);
|
|
spin_unlock(&ino->i_lock);
|
|
|
|
|
|
@@ -1614,6 +1638,8 @@ lookup_again:
|
|
lseg = send_layoutget(lo, ctx, &arg, gfp_flags);
|
|
lseg = send_layoutget(lo, ctx, &arg, gfp_flags);
|
|
pnfs_clear_retry_layoutget(lo);
|
|
pnfs_clear_retry_layoutget(lo);
|
|
atomic_dec(&lo->plh_outstanding);
|
|
atomic_dec(&lo->plh_outstanding);
|
|
|
|
+ trace_pnfs_update_layout(ino, pos, count, iomode, lseg,
|
|
|
|
+ PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET);
|
|
out_put_layout_hdr:
|
|
out_put_layout_hdr:
|
|
if (first)
|
|
if (first)
|
|
pnfs_clear_first_layoutget(lo);
|
|
pnfs_clear_first_layoutget(lo);
|