title: How to accelerate Reading/Writing Attribute Data?
body: <p>I used File attributes in the sys filesystem which allow userspace to communicate with the driver using SysFS. The problem is that I have much data to be transfered so I lost much time. This is a very slow process!</p>
  
  <p>In the kennel module I have this part of the code:</p>
  
  <pre><code>static DEVICE_ATTR(writeFile,S_IWUSR,NULL,writeFunction);
  
  static DEVICE_ATTR(resultFile,S_IRUSR, readFunction, NULL);
  
      static ssize_t writeFunction(struct device *dev, struct device_attribute *attr,
       const char * buf, size_t count) {
  
      if(count &gt;0){
      resp_ready = 1;
  
      sscanf(buf,"%2x,",&amp;src_vect[0]);
      for (i=0;i&lt;80;i++)
               {
                  sscanf(buf+3+12*i,"%2x,%2x,%2x,%2x,",&amp;src_vect[4*i+1],&amp;src_vect[4*i+2],&amp;src_vect[4*i+3],&amp;src_vect[4*i+4]);
  
               }
      .
      .
      .
          }
  
  static ssize_t readFunction(struct device *dev, struct device_attribute *attr, char *buf) {
  
  //write the result to buf   
         for (i=0;i&lt;6;i++)
            {  
              sprintf(buf+72*i,"%8x,%8x,%8x,%8x,%8x,%8x,%8x,%8x,",dst_f[8*i],dst_f[8*i+1],dst_f[8*i+2],dst_f[8*i+3],dst_f[8*i+4],dst_f[8*i+5],dst_f[8*i+6],dst_f[8*i+7]);
  
            }
  .
  .
  .
  }
  </code></pre>
  
  <p>How can I reduce data transfer time from/to user/kennel space?
  Is there any method faster than this one?</p>