summaryrefslogtreecommitdiff
path: root/fs/yaffs2/yaffs_getblockinfo.h
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2010-05-18 20:35:30 -0700
committerColin Cross <ccross@android.com>2010-09-29 17:49:17 -0700
commit9713f5863cad583550e5a99236df769d4baf1694 (patch)
tree7aa86481d48bd25c9e906350fae019dd7070bb0f /fs/yaffs2/yaffs_getblockinfo.h
parent13b56cd2bdb61603b4dc38b914912ba74d75d301 (diff)
yaffs: Import yaffs from Wed May 19 12:46:51 2010 +1200
commit 294ec3ddf9786bddb329646010b165768870ce42 Author: Charles Manning <cdhmanning@gmail.com> Date: Wed May 19 12:46:51 2010 +1200 yaffs: Add python test for O_EXCL Check that OEXCL really works according to what's on the box. Signed-off-by: Charles Manning <cdhmanning@gmail.com> Change-Id: Idc6864901461dabfb7648f34db57238cdbbaaa72 Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'fs/yaffs2/yaffs_getblockinfo.h')
-rw-r--r--fs/yaffs2/yaffs_getblockinfo.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/fs/yaffs2/yaffs_getblockinfo.h b/fs/yaffs2/yaffs_getblockinfo.h
new file mode 100644
index 000000000000..71fe1deea3c6
--- /dev/null
+++ b/fs/yaffs2/yaffs_getblockinfo.h
@@ -0,0 +1,35 @@
+/*
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Charles Manning <charles@aleph1.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
+ */
+
+#ifndef __YAFFS_GETBLOCKINFO_H__
+#define __YAFFS_GETBLOCKINFO_H__
+
+#include "yaffs_guts.h"
+#include "yaffs_trace.h"
+
+/* Function to manipulate block info */
+static Y_INLINE yaffs_BlockInfo *yaffs_GetBlockInfo(yaffs_Device * dev, int blk)
+{
+ if (blk < dev->internalStartBlock || blk > dev->internalEndBlock) {
+ T(YAFFS_TRACE_ERROR,
+ (TSTR
+ ("**>> yaffs: getBlockInfo block %d is not valid" TENDSTR),
+ blk));
+ YBUG();
+ }
+ return &dev->blockInfo[blk - dev->internalStartBlock];
+}
+
+#endif