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

From: Anna Schumaker <[email-masked]>
Date: Thu, 31 Oct 2013 17:16:33 -0400

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

---

From: "Haynes, Tom" <[email-masked]>
Date: Fri, 1 Nov 2013 01:17:52 +0000

> When will the wp_data array have more than one operation at once?

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<>;
   /// };