From f72fbd4db6969a222de4c71d9e8a8f00cda7d054 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 18 Sep 2013 23:43:50 +0400 Subject: [PATCH] Add new const SIMPLEFS_START_INO instead of magic number --- simple.c | 2 +- simple.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/simple.c b/simple.c index b087c57..0e90863 100644 --- a/simple.c +++ b/simple.c @@ -474,7 +474,7 @@ static int simplefs_create_fs_object(struct inode *dir, struct dentry *dentry, inode->i_sb = sb; inode->i_op = &simplefs_inode_ops; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; - inode->i_ino = 10; + inode->i_ino = SIMPLEFS_START_INO; /* Loop until we get an unique inode number */ while (simplefs_get_inode(sb, inode->i_ino)) { diff --git a/simple.h b/simple.h index 11639b6..e114cdc 100644 --- a/simple.h +++ b/simple.h @@ -1,6 +1,7 @@ #define SIMPLEFS_MAGIC 0x10032013 #define SIMPLEFS_DEFAULT_BLOCK_SIZE 4096 #define SIMPLEFS_FILENAME_MAXLEN 255 +#define SIMPLEFS_START_INO 10 /* Hard-coded inode number for the root directory */ const int SIMPLEFS_ROOTDIR_INODE_NUMBER = 1;