[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fuse-devel
Subject:    [fuse-devel] how does write works?
From:       Serdar Dere <serdar () serdar-dere ! net>
Date:       2010-12-29 19:40:56
Message-ID: 4D1B8EC8.6050506 () serdar-dere ! net
[Download RAW message or body]

Hello guys,

I am trying to understand how write works and I guess I made some mistakes.
I am trying to write the buffer buf to a voidpointer. but it stops at 2.2M.
That's why I am thinking, I understand it wrong how write is working, 
maybw someone can explain it to me.

Thanks in advance

Greetings Serdar

/**
  *      writes a file or append to a file.
  **/
static int ossfs_write(const char *path, const char *buf, size_t size,
                 off_t offset, struct fuse_file_info *fi) {
     (void)offset;
     oss_inode *node = getNode(path);
     if(node == NULL)
         return -ENOENT;

     oss_consistency_model_t consmod = oss_transactional_consistency;
     oss_alloc_attributes_t attr = oss_default_alloc_attributes;

     void *data = NULL;
     if (node->data != NULL){
         data = malloc(sizeof(void)*node->len);
         memcpy(data, node->data, node->len);
         oss_free(node->data);
     }

     node->data = oss_alloc(sizeof(void)*(size+offset), consmod, &attr);
     if(data == NULL)
         memcpy(node->data,buf,size);
     else {
         memcpy(node->data,data,offset);
         memcpy(node->data+offset,buf,size);
     }

     node->len = size+offset;
     return size;
}

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
fuse-devel mailing list
fuse-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuse-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic