Hints for implementing max size limit on posix xlator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Im trying to figure how limit filesize available as per option request

Something like

volume posix-brick0
           type storage/posix
           option directory /export/some_dir
           option filesystem_size 10GB
   end-volume

Should I intercept statfs return values to ensure 

buf.f_bfree <= filesystem_size
buf.f_bavail <=filesystem_size

this is right??

whats the best version for patches? i assume is tla636

int32_t
posix_statfs (call_frame_t *frame,
              xlator_t *this,
              loc_t *loc)

{
  int32_t op_ret;
  int32_t op_errno;
  char *real_path;
  struct statvfs buf = {0, };

  MAKE_REAL_PATH (real_path, this, loc->path);

  op_ret = statvfs (real_path, &buf);
  op_errno = errno;

  frame->root->rsp_refs = NULL;
  STACK_UNWIND (frame, op_ret, op_errno, &buf);
  return 0;
}


Regards
-- 
------------------------------------------------
Clist UAH
------------------------------------------------




[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux