diff options
| author | Jonathan Curley <jcurley@purestorage.com> | 2025-09-24 16:20:44 +0000 |
|---|---|---|
| committer | Anna Schumaker <anna.schumaker@oracle.com> | 2025-09-26 15:32:24 -0400 |
| commit | d442670c0f63c46b7f348f68fb2002af597708f2 (patch) | |
| tree | beffa69724f061ae83c458bda19f05a980f47861 /fs/nfs/flexfilelayout/flexfilelayout.h | |
| parent | NFSv4/flexfiles: Use ds_commit_idx when marking a write commit (diff) | |
| download | linux-d442670c0f63c46b7f348f68fb2002af597708f2.tar.gz linux-d442670c0f63c46b7f348f68fb2002af597708f2.zip | |
NFSv4/flexfiles: Add data structure support for striped layouts
Adds a new struct nfs4_ff_layout_ds_stripe that represents a data
server stripe within a layout. A new dynamically allocated array of
this type has been added to nfs4_ff_layout_mirror and per stripe
configuration information has been moved from the mirror type to the
stripe based on the RFC.
Signed-off-by: Jonathan Curley <jcurley@purestorage.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Diffstat (limited to 'fs/nfs/flexfilelayout/flexfilelayout.h')
| -rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.h b/fs/nfs/flexfilelayout/flexfilelayout.h index 095df09017a5..14640452713b 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.h +++ b/fs/nfs/flexfilelayout/flexfilelayout.h @@ -71,12 +71,12 @@ struct nfs4_ff_layoutstat { struct nfs4_ff_busy_timer busy_timer; }; -struct nfs4_ff_layout_mirror { - struct pnfs_layout_hdr *layout; - struct list_head mirrors; - u32 ds_count; - u32 efficiency; +struct nfs4_ff_layout_mirror; + +struct nfs4_ff_layout_ds_stripe { + struct nfs4_ff_layout_mirror *mirror; struct nfs4_deviceid devid; + u32 efficiency; struct nfs4_ff_layout_ds *mirror_ds; u32 fh_versions_cnt; struct nfs_fh *fh_versions; @@ -84,12 +84,19 @@ struct nfs4_ff_layout_mirror { const struct cred __rcu *ro_cred; const struct cred __rcu *rw_cred; struct nfs_file_localio nfl; - refcount_t ref; - spinlock_t lock; - unsigned long flags; struct nfs4_ff_layoutstat read_stat; struct nfs4_ff_layoutstat write_stat; ktime_t start_time; +}; + +struct nfs4_ff_layout_mirror { + struct pnfs_layout_hdr *layout; + struct list_head mirrors; + u32 dss_count; + struct nfs4_ff_layout_ds_stripe *dss; + refcount_t ref; + spinlock_t lock; + unsigned long flags; u32 report_interval; }; @@ -155,7 +162,7 @@ FF_LAYOUT_DEVID_NODE(struct pnfs_layout_segment *lseg, u32 idx) struct nfs4_ff_layout_mirror *mirror = FF_LAYOUT_COMP(lseg, idx); if (mirror != NULL) { - struct nfs4_ff_layout_ds *mirror_ds = mirror->mirror_ds; + struct nfs4_ff_layout_ds *mirror_ds = mirror->dss[0].mirror_ds; if (!IS_ERR_OR_NULL(mirror_ds)) return &mirror_ds->id_node; @@ -184,7 +191,7 @@ ff_layout_no_read_on_rw(struct pnfs_layout_segment *lseg) static inline int nfs4_ff_layout_ds_version(const struct nfs4_ff_layout_mirror *mirror) { - return mirror->mirror_ds->ds_versions[0].version; + return mirror->dss[0].mirror_ds->ds_versions[0].version; } struct nfs4_ff_layout_ds * |
