]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/gfs2/ops_address.c
[PATCH] mark struct file_operations const 6
[karo-tx-linux.git] / fs / gfs2 / ops_address.c
index 9ddf9753a552c86cf14cb675ce856f53646902f6..56e33590b65661cec2bd8cdf8c375513d450c153 100644 (file)
@@ -170,7 +170,8 @@ out_ignore:
  * and write whole extents at once. This is a big reduction in the
  * number of I/O requests we send and the bmap calls we make in this case.
  */
-int gfs2_writepages(struct address_space *mapping, struct writeback_control *wbc)
+static int gfs2_writepages(struct address_space *mapping,
+                          struct writeback_control *wbc)
 {
        struct inode *inode = mapping->host;
        struct gfs2_inode *ip = GFS2_I(inode);
@@ -360,8 +361,10 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
        gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_ATIME|LM_FLAG_TRY_1CB, &ip->i_gh);
        error = gfs2_glock_nq_atime(&ip->i_gh);
        if (unlikely(error)) {
-               if (error == GLR_TRYFAILED)
+               if (error == GLR_TRYFAILED) {
+                       unlock_page(page);
                        error = AOP_TRUNCATED_PAGE;
+               }
                goto out_uninit;
        }