message: rafs: configure io amplificaton from rafs conf file
  By default, it is disabled. If want to enable this feature,
  give a non-zero value and set it to amplifying size
diff: @@ -45,9 +45,6 @@ pub const RAFS_DEFAULT_ENTRY_TIMEOUT: u64 = RAFS_DEFAULT_ATTR_TIMEOUT;
  const DOT: &str = ".";
  const DOTDOT: &str = "..";
  -// TODO: Make this configurable from rafs configuration file
  -const AMPLIFIED_SIZE: usize = 1024 * 128;
  -
  fn default_threads_count() -> usize {
  8
  }
  @@ -60,6 +57,10 @@ fn default_prefetch_all() -> bool {
  true
  }
  +fn default_amplify_io() -> u32 {
  + 128 * 1024
  +}
  +
  #[derive(Clone, Default, Deserialize)]
  pub struct FsPrefetchControl {
  #[serde(default)]
  @@ -110,6 +111,9 @@ pub struct RafsConfig {
  pub access_pattern: bool,
  #[serde(default)]
  pub latest_read_files: bool,
  + // ZERO value means, amplifying user io is not enabled.
  + #[serde(default = "default_amplify_io")]
  + pub amplify_io: u32,
  }
  impl FromStr for RafsConfig {
  @@ -154,6 +158,7 @@ pub struct Rafs {
  initialized: bool,
  xattr_enabled: bool,
  ios: Arc<metrics::GlobalIoStats>,
  + amplify_io: u32,
  // static inode attributes
  i_uid: u32,
  i_gid: u32,
  @@ -202,6 +207,7 @@ impl Rafs {
  ios: metrics::new(id),
  digest_validate: conf.digest_validate,
  fs_prefetch: conf.fs_prefetch.enable,
  + amplify_io: conf.amplify_io,
  prefetch_all: conf.fs_prefetch.prefetch_all,
  xattr_enabled: conf.enable_xattr,
  i_uid: geteuid().into(),
  @@ -614,7 +620,8 @@ impl FileSystem for Rafs {
  let mut desc = inode.alloc_bio_desc(offset, size as usize, true)?;
  let mut all_cached = true;
  - if let Some(d) = AMPLIFIED_SIZE.checked_sub(size as usize) {
  + if self.amplify_io != 0 {
  + if let Some(d) = self.amplify_io.checked_sub(size) {
  for b in &desc.bi_vec {
  let c = b.chunkinfo.as_ref();
  let blob = b.blob.as_ref();
  @@ -633,6 +640,7 @@ impl FileSystem for Rafs {
  };
  }
  }
  + }
  let start = self.ios.latency_start();
  // Avoid copying `desc`
  