[Ocfs2-commits] manish commits r2226 - trunk/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed May 11 18:33:03 CDT 2005
Author: manish
Signed-off-by: mfasheh
Date: 2005-05-11 18:33:01 -0500 (Wed, 11 May 2005)
New Revision: 2226
Modified:
trunk/fs/ocfs2/aops.c
Log:
Support bmap for non-journal files, mainly to get swapfiles on ocfs2 working.
Signed-off-by: mfasheh
Modified: trunk/fs/ocfs2/aops.c
===================================================================
--- trunk/fs/ocfs2/aops.c 2005-05-11 23:06:43 UTC (rev 2225)
+++ trunk/fs/ocfs2/aops.c 2005-05-11 23:33:01 UTC (rev 2226)
@@ -33,6 +33,7 @@
#include "alloc.h"
#include "buffer_head_io.h"
+#include "dlmglue.h"
#include "extent_map.h"
#include "file.h"
#include "inode.h"
@@ -281,15 +282,23 @@
mlog_entry("(block = %llu)\n", (unsigned long long)block);
+ /* We don't need to lock journal system files, since they aren't
+ * accessed concurrently from multiple nodes.
+ */
if (!INODE_JOURNAL(inode)) {
- mlog(ML_ERROR, "bmap is only for journal inodes!\n");
- err = -EINVAL;
- mlog_errno(err);
- goto bail;
+ err = ocfs2_meta_lock(inode, NULL, NULL, 0);
+ if (err) {
+ mlog_errno(err);
+ goto bail;
+ }
}
err = ocfs2_extent_map_get_blocks(inode, block, 1, &p_blkno,
NULL);
+
+ if (!INODE_JOURNAL(inode))
+ ocfs2_meta_unlock(inode, 0);
+
if (err) {
mlog(ML_ERROR, "get_blocks() failed, block = %llu\n",
(unsigned long long)block);
More information about the Ocfs2-commits
mailing list