All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Haynes <loghyr@primarydata.com>
To: Jeff Layton <jlayton@poochiereds.net>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	Linux NFS Mailing list <linux-nfs@vger.kernel.org>,
	hch <hch@lst.de>
Subject: Re: [PATCH 3/4] nfsd: Add a super simple flex file server
Date: Wed, 25 May 2016 14:41:44 +0000	[thread overview]
Message-ID: <D723CF25-D851-4523-8960-528700738792@primarydata.com> (raw)
In-Reply-To: <1464179444.3037.15.camel@poochiereds.net>


> On May 25, 2016, at 5:30 AM, Jeff Layton <jlayton@poochiereds.net> wrote:
> 
> On Tue, 2016-05-24 at 22:09 -0700, Tom Haynes wrote:
>> 
>>  void nfsd4_setup_layout_type(struct svc_export *exp)
>>  {
>> +#if defined(CONFIG_NFSD_BLOCKLAYOUT) || defined(CONFIG_NFSD_SCSILAYOUT)
>>  	struct super_block *sb = exp->ex_path.mnt->mnt_sb;
>> +#endif
>>  
>>  	if (!(exp->ex_flags & NFSEXP_PNFS))
>>  		return;
>> @@ -145,6 +150,11 @@ void nfsd4_setup_layout_type(struct svc_export *exp)
>>  	    sb->s_bdev && sb->s_bdev->bd_disk->fops->pr_ops)
>>  		exp->ex_layout_type = LAYOUT_SCSI;
>>  #endif
>> +#ifdef CONFIG_NFSD_FLEXFILELAYOUT
>> +	// FIXME: How do we "export" this and how does it mingle with
>> +	// the above types?
>> +	exp->ex_layout_type = LAYOUT_FLEX_FILES;
>> +#endif
>>  }
>>  
> 
> Maybe it's time to start thinking about how to support multiple layout types per export? It doesn't look like it would be that hard. I think we could convert ex_layout_type into a bitmap that shows which types are supported.
> 
> The harder work looks to be on the client. You'd need some heuristic to choose when you get back multiple layout types and fix that to work properly.


In thinking about it, if we rearrange the code to be:

void nfsd4_setup_layout_type(struct svc_export *exp)
{
#if defined(CONFIG_NFSD_BLOCKLAYOUT) || defined(CONFIG_NFSD_SCSILAYOUT)
        struct super_block *sb = exp->ex_path.mnt->mnt_sb;
#endif
        
        if (!(exp->ex_flags & NFSEXP_PNFS))
                return;
        
        /*
         * If flex file is configured, use it by default. Otherwise
         * check if the file system supports exporting a block-like layout.
         * If the block device supports reservations prefer the SCSI layout,
         * otherwise advertise the block layout.
         */
#ifdef CONFIG_NFSD_FLEXFILELAYOUT
        // FIXME: How do we "export" this and how does it mingle with
        // the above types? 
        exp->ex_layout_type = LAYOUT_FLEX_FILES;
#endif
#ifdef CONFIG_NFSD_BLOCKLAYOUT
        /* overwrite flex file layout selection if needed */
        if (sb->s_export_op->get_uuid &&
            sb->s_export_op->map_blocks &&
            sb->s_export_op->commit_blocks)
                exp->ex_layout_type = LAYOUT_BLOCK_VOLUME;
#endif
#ifdef CONFIG_NFSD_SCSILAYOUT
        /* overwrite block layout selection if needed */
        if (sb->s_export_op->map_blocks && 
            sb->s_export_op->commit_blocks &&
            sb->s_bdev && sb->s_bdev->bd_disk->fops->pr_ops)
                exp->ex_layout_type = LAYOUT_SCSI;
#endif
}

We get what seems natural.



  reply	other threads:[~2016-05-25 14:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25  5:09 [PATCH 0/4] Super simple flex file server Tom Haynes
2016-05-25  5:09 ` [PATCH 1/4] nfsd: flex file device id encoding will need the server addres Tom Haynes
2016-05-25 11:49   ` Jeff Layton
2016-05-25 15:08   ` Christoph Hellwig
2016-05-25  5:09 ` [PATCH 2/4] nfsd: Can leak pnfs_block_extent on error Tom Haynes
2016-05-25 11:50   ` Jeff Layton
2016-05-25 15:07   ` Christoph Hellwig
2016-05-25 18:12     ` Thomas Haynes
2016-05-25 18:20       ` J. Bruce Fields
2016-05-25  5:09 ` [PATCH 3/4] nfsd: Add a super simple flex file server Tom Haynes
2016-05-25 12:00   ` Jeff Layton
2016-05-25 12:30   ` Jeff Layton
2016-05-25 14:41     ` Thomas Haynes [this message]
2016-05-25 17:42     ` J. Bruce Fields
2016-05-25 21:57       ` Jeff Layton
2016-05-26 13:18         ` J. Bruce Fields
2016-05-25 15:15   ` Christoph Hellwig
2016-05-26  5:37     ` Thomas Haynes
2016-05-25  5:09 ` [PATCH 4/4] nfsd: Provide a config option for flex file layouts Tom Haynes
2016-05-25 15:09   ` Christoph Hellwig
2016-05-25 18:19     ` Thomas Haynes
2016-05-25 18:21       ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D723CF25-D851-4523-8960-528700738792@primarydata.com \
    --to=loghyr@primarydata.com \
    --cc=bfields@fieldses.org \
    --cc=hch@lst.de \
    --cc=jlayton@poochiereds.net \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.