]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/linux-2.6/xfs_buf.h
Fix barrier fail detection in XFS
[linux-2.6-omap-h63xx.git] / fs / xfs / linux-2.6 / xfs_buf.h
index 29d1d4adc07897a7fdb47b76b4deb9fbf4c78e27..456519a088c7bfb5ba472f0a8125818a46a5ac5b 100644 (file)
@@ -85,6 +85,14 @@ typedef enum {
         * modifications being lost.
         */
        _XBF_PAGE_LOCKED = (1 << 22),
+
+       /*
+        * If we try a barrier write, but it fails we have to communicate
+        * this to the upper layers.  Unfortunately b_error gets overwritten
+        * when the buffer is re-issued so we have to add another flag to
+        * keep this information.
+        */
+       _XFS_BARRIER_FAILED = (1 << 23),
 } xfs_buf_flags_t;
 
 typedef enum {
@@ -157,7 +165,7 @@ typedef struct xfs_buf {
        xfs_buf_iodone_t        b_iodone;       /* I/O completion function */
        xfs_buf_relse_t         b_relse;        /* releasing function */
        xfs_buf_bdstrat_t       b_strat;        /* pre-write function */
-       struct semaphore        b_iodonesema;   /* Semaphore for I/O waiters */
+       struct completion       b_iowait;       /* queue for I/O waiters */
        void                    *b_fspriv;
        void                    *b_fspriv2;
        void                    *b_fspriv3;
@@ -352,7 +360,7 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *);
 #define XFS_BUF_CPSEMA(bp)     (xfs_buf_cond_lock(bp) == 0)
 #define XFS_BUF_VSEMA(bp)      xfs_buf_unlock(bp)
 #define XFS_BUF_PSEMA(bp,x)    xfs_buf_lock(bp)
-#define XFS_BUF_V_IODONESEMA(bp) up(&bp->b_iodonesema);
+#define XFS_BUF_FINISH_IOWAIT(bp)      complete(&bp->b_iowait);
 
 #define XFS_BUF_SET_TARGET(bp, target) ((bp)->b_target = (target))
 #define XFS_BUF_TARGET(bp)             ((bp)->b_target)