[Gluster-devel] Hints for implementing max size limit on posix xlator

Angel clist at uah.es
Wed Jan 16 16:01:48 UTC 2008


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
------------------------------------------------





More information about the Gluster-devel mailing list