pnfs: record sequence in pnfs_layout_segment when it's created
authorJeff Layton <jlayton@poochiereds.net>
Tue, 17 May 2016 16:28:40 +0000 (12:28 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 17 May 2016 19:48:09 +0000 (15:48 -0400)
In later patches, we're going to teach the client to be more selective
about how it returns layouts. This means keeping a record of what the
stateid's seqid was at the time that the server handed out a layout
segment.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/pnfs.c
fs/nfs/pnfs.h

index faea98281c75adc81c805be585d808a50e27dea3..c09ced88bd388867e2b4b31fca4297ea4a96833d 100644 (file)
@@ -1697,6 +1697,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
 
        init_lseg(lo, lseg);
        lseg->pls_range = res->range;
+       lseg->pls_seq = be32_to_cpu(res->stateid.seqid);
 
        spin_lock(&ino->i_lock);
        if (pnfs_layoutgets_blocked(lo)) {
index 7222d3a35439cc70ff4474e4c3c2f84724e1a95e..361fa5494aa5d2d4b662d944a860ebb54b7ffa71 100644 (file)
@@ -64,6 +64,7 @@ struct pnfs_layout_segment {
        struct list_head pls_lc_list;
        struct pnfs_layout_range pls_range;
        atomic_t pls_refcount;
+       u32 pls_seq;
        unsigned long pls_flags;
        struct pnfs_layout_hdr *pls_layout;
        struct work_struct pls_work;