]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'xfs-dax-updates' into for-next
authorDave Chinner <david@fromorbit.com>
Tue, 3 Nov 2015 02:28:41 +0000 (13:28 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 3 Nov 2015 02:28:41 +0000 (13:28 +1100)
1  2 
fs/xfs/libxfs/xfs_alloc.c
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/xfs_aops.c
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_file.c
fs/xfs/xfs_iomap.c
fs/xfs/xfs_mount.h
fs/xfs/xfs_trace.h

Simple merge
Simple merge
index e4fff5898c1c0eefd4fb053b028bd357e6dd69d8,69c2dbc20836a025f767ecdcb86b0f11d48cd635..29e7e5dd5178ef84638752f31ce6149c64398061
@@@ -1405,15 -1421,16 +1430,16 @@@ __xfs_get_blocks
        if (create &&
            (!nimaps ||
             (imap.br_startblock == HOLESTARTBLOCK ||
-             imap.br_startblock == DELAYSTARTBLOCK))) {
+             imap.br_startblock == DELAYSTARTBLOCK) ||
+            (IS_DAX(inode) && ISUNWRITTEN(&imap)))) {
                if (direct || xfs_get_extsz_hint(ip)) {
                        /*
 -                       * Drop the ilock in preparation for starting the block
 -                       * allocation transaction.  It will be retaken
 -                       * exclusively inside xfs_iomap_write_direct for the
 -                       * actual allocation.
 +                       * xfs_iomap_write_direct() expects the shared lock. It
 +                       * is unlocked on return.
                         */
 -                      xfs_iunlock(ip, lockmode);
 +                      if (lockmode == XFS_ILOCK_EXCL)
 +                              xfs_ilock_demote(ip, lockmode);
 +
                        error = xfs_iomap_write_direct(ip, offset, size,
                                                       &imap, nimaps);
                        if (error)
Simple merge
Simple merge
index c3cb5a552c4eb2fae269bbed95e40c86fa8a93f5,b48c6b525e776b20d7dc5649b933863cd6966203..f4f5b43cf64712cf8fe46924820142fc75a33e86
@@@ -131,13 -131,14 +131,14 @@@ xfs_iomap_write_direct
        uint            qblocks, resblks, resrtextents;
        int             committed;
        int             error;
 +      int             lockmode;
+       int             bmapi_flags = XFS_BMAPI_PREALLOC;
  
 -      error = xfs_qm_dqattach(ip, 0);
 -      if (error)
 -              return error;
 -
        rt = XFS_IS_REALTIME_INODE(ip);
        extsz = xfs_get_extsz_hint(ip);
 +      lockmode = XFS_ILOCK_SHARED;    /* locked by caller */
 +
 +      ASSERT(xfs_isilocked(ip, lockmode));
  
        offset_fsb = XFS_B_TO_FSBT(mp, offset);
        last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count)));
        xfs_bmap_init(&free_list, &firstfsb);
        nimaps = 1;
        error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb,
-                               XFS_BMAPI_PREALLOC, &firstfsb, resblks, imap,
 -                              bmapi_flags, &firstfsb, 0, imap,
++                              bmapi_flags, &firstfsb, resblks, imap,
                                &nimaps, &free_list);
        if (error)
                goto out_bmap_cancel;
Simple merge
Simple merge