@@ -136,13 +136,15 @@ EXPORT_SYMBOL(generic_fill_statx_attr);
136136 * @stat: Where to fill in the attribute flags
137137 * @unit_min: Minimum supported atomic write length in bytes
138138 * @unit_max: Maximum supported atomic write length in bytes
139+ * @unit_max_opt: Optimised maximum supported atomic write length in bytes
139140 *
140141 * Fill in the STATX{_ATTR}_WRITE_ATOMIC flags in the kstat structure from
141142 * atomic write unit_min and unit_max values.
142143 */
143144void generic_fill_statx_atomic_writes (struct kstat * stat ,
144145 unsigned int unit_min ,
145- unsigned int unit_max )
146+ unsigned int unit_max ,
147+ unsigned int unit_max_opt )
146148{
147149 /* Confirm that the request type is known */
148150 stat -> result_mask |= STATX_WRITE_ATOMIC ;
@@ -153,6 +155,7 @@ void generic_fill_statx_atomic_writes(struct kstat *stat,
153155 if (unit_min ) {
154156 stat -> atomic_write_unit_min = unit_min ;
155157 stat -> atomic_write_unit_max = unit_max ;
158+ stat -> atomic_write_unit_max_opt = unit_max_opt ;
156159 /* Initially only allow 1x segment */
157160 stat -> atomic_write_segments_max = 1 ;
158161
@@ -732,6 +735,7 @@ cp_statx(const struct kstat *stat, struct statx __user *buffer)
732735 tmp .stx_atomic_write_unit_min = stat -> atomic_write_unit_min ;
733736 tmp .stx_atomic_write_unit_max = stat -> atomic_write_unit_max ;
734737 tmp .stx_atomic_write_segments_max = stat -> atomic_write_segments_max ;
738+ tmp .stx_atomic_write_unit_max_opt = stat -> atomic_write_unit_max_opt ;
735739
736740 return copy_to_user (buffer , & tmp , sizeof (tmp )) ? - EFAULT : 0 ;
737741}
0 commit comments