Subject: Re: [nfsv4] NFS v4.2: WRITE_PLUS4args wp_data<> array

From: Anna Schumaker <[email-masked]>
Date: Fri, 1 Nov 2013 08:53:38 -0400

On 10/31/2013 09:17 PM, Haynes, Tom wrote:
> 
> On Oct 31, 2013, at 2:16 PM, Anna Schumaker <[email-masked]> wrote:
> 
>> Hi everybody,
>>
>> What is the use case behind having a WRITE_PLUS4args wp_data<> array, rather than asking clients to use one arm of the discriminated union at a time?  On Linux you will access the NFS4_CONTENT_DATA arm through the write() system call and NFS4_CONTENT_HOLE through fallocate().  These happen through different system calls at different times and won't be grouped into a single operation.
>>
>> When will the wp_data array have more than one operation at once?
>>
>> Anna
> 
> So we had READ_PLUS and WRITE_PLUS returning an array at one point.
> 
> We took that out.  I think that means that:
> 
>    /// union write_plus_arg4 switch (data_content4 wpa_content) {
>    /// case NFS4_CONTENT_DATA:
>    ///         data4           wpa_data;
>    /// case NFS4_CONTENT_APP_DATA_HOLE:
>    ///         app_data_hole4  wpa_adh;
>    /// case NFS4_CONTENT_HOLE:
>    ///         data_info4      wpa_hole;
>    /// default:
>    ///         void;
>    /// };
>    ///
>    /// struct WRITE_PLUS4args {
>    ///         /* CURRENT_FH: file */
>    ///         stateid4        wp_stateid;
>    ///         stable_how4     wp_stable;
>    ///         write_plus_arg4 wp_data<>;
>    /// };
> 
> should actually be:
> 
>    /// union write_plus_arg4 switch (data_content4 wpa_content) {
>    /// case NFS4_CONTENT_DATA:
>    ///         data4           wpa_data<>;
>    /// case NFS4_CONTENT_APP_DATA_HOLE:
>    ///         app_data_hole4  wpa_adh;
>    /// case NFS4_CONTENT_HOLE:
>    ///         data_info4      wpa_hole;
>    /// default:
>    ///         void;
>    /// };
>    ///
>    /// struct WRITE_PLUS4args {
>    ///         /* CURRENT_FH: file */
>    ///         stateid4        wp_stateid;
>    ///         stable_how4     wp_stable;
>    ///         write_plus_arg4 wp_data;
>    /// };
> 
> to be more like:
> 
>    /// struct WRITE4args {
>    ///         /* CURRENT_FH: file */
>    ///         stateid4        stateid;
>    ///         offset4         offset;
>    ///         stable_how4     stable;
>    ///         opaque          data<>;
>    /// };
> 
> 

Maybe...

  /// struct data4 {
  ///         offset4         d_offset;
  ///         bool            d_allocated;
  ///         opaque          d_data<>;
  /// };

Would that still indicate a contiguous array of data4 objects?  data4 already indicates that it takes a chunk of data the way it's written now.

---

From: Marc Eshel <[email-masked]>
Date: Fri, 1 Nov 2013 07:59:42 -0700

Are you sure we are allowing an array of data4? that means that we are 
allowing one write call to give a list of ranges to write. Maybe it should 
be just 
/// case NFS4_CONTENT_DATA:
///         data4           wpa_data;
Marc.

[email-masked] wrote on 10/31/2013 06:17:52 PM:

> From: "Haynes, Tom" <[email-masked]>
> To: "Schumaker, Bryan" <[email-masked]>, 
> Cc: "[email-masked]" <[email-masked]>
> Date: 10/31/2013 06:39 PM
> Subject: Re: [nfsv4] NFS v4.2: WRITE_PLUS4args wp_data<> array
> Sent by: [email-masked]
> 
> 
> > What is the use case behind having a WRITE_PLUS4args wp_data<> 
> array, rather than asking clients to use one arm of the 
> discriminated union at a time?  On Linux you will access the 
> NFS4_CONTENT_DATA arm through the write() system call and 
> NFS4_CONTENT_HOLE through fallocate().  These happen through 
> different system calls at different times and won't be grouped into 
> a single operation.
> > 
> _______________________________________________
> nfsv4 mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/nfsv4
>

---

From: "Haynes, Tom" <[email-masked]>
Date: Fri, 1 Nov 2013 16:36:40 +0000

On Nov 1, 2013, at 5:53 AM, Anna Schumaker <[email-masked]<mailto:[email-masked]>> wrote:

On Oct 31, 2013, at 2:16 PM, Anna Schumaker <[email-masked]<mailto:[email-masked]>> wrote:

Hi everybody,

Anna

should actually be:

to be more like:

  /// struct WRITE4args {

Maybe...

 /// struct data4 {
 ///         offset4         d_offset;
 ///         bool            d_allocated;
 ///         opaque          d_data<>;
 /// };

Right, so the final change would be to just remove the array from wp_data: