OSDN Git Service

Merge branch 'xfs-dax-support' into for-next
authorDave Chinner <david@fromorbit.com>
Thu, 4 Jun 2015 03:01:49 +0000 (13:01 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 4 Jun 2015 03:01:49 +0000 (13:01 +1000)
1  2 
fs/xfs/xfs_file.c
fs/xfs/xfs_mount.h

@@@ -108,23 -110,30 +110,30 @@@ xfs_iozero
                if (bytes > count)
                        bytes = count;
  
-               status = pagecache_write_begin(NULL, mapping, pos, bytes,
-                                       AOP_FLAG_UNINTERRUPTIBLE,
-                                       &page, &fsdata);
-               if (status)
-                       break;
+               if (IS_DAX(VFS_I(ip))) {
+                       status = dax_zero_page_range(VFS_I(ip), pos, bytes,
+                                                    xfs_get_blocks_direct);
+                       if (status)
+                               break;
+               } else {
+                       status = pagecache_write_begin(NULL, mapping, pos, bytes,
+                                               AOP_FLAG_UNINTERRUPTIBLE,
+                                               &page, &fsdata);
+                       if (status)
+                               break;
  
-               zero_user(page, offset, bytes);
+                       zero_user(page, offset, bytes);
  
-               status = pagecache_write_end(NULL, mapping, pos, bytes, bytes,
-                                       page, fsdata);
-               WARN_ON(status <= 0); /* can't return less than zero! */
+                       status = pagecache_write_end(NULL, mapping, pos, bytes,
+                                               bytes, page, fsdata);
+                       WARN_ON(status <= 0); /* can't return less than zero! */
+                       status = 0;
+               }
                pos += bytes;
                count -= bytes;
-               status = 0;
        } while (count);
  
 -      return (-status);
 +      return status;
  }
  
  int
Simple merge