Commit 3be35a97 authored by J. R. Okajima's avatar J. R. Okajima
Browse files

aufs: fhsm (file-based hierarchical storage management)



This feature automatically handles MVDOWN in other commits.
In user-space, a daemon monitors the free space of the branch and issues
MVDOWN ioctl automatically when necessary. The main role is in
user-space and several options are implemented.
For a branch to join the FHSM circle, a new attribute 'fhsm' should be
specified.

See also the document in this commit.
Signed-off-by: default avatarJ. R. Okajima <hooanon05g@gmail.com>
parent 08363511
...@@ -81,6 +81,7 @@ typedef int16_t aufs_bindex_t; ...@@ -81,6 +81,7 @@ typedef int16_t aufs_bindex_t;
#define AUFS_WKQ_NAME AUFS_NAME "d" #define AUFS_WKQ_NAME AUFS_NAME "d"
#define AUFS_MFS_DEF_SEC 30 /* seconds */ #define AUFS_MFS_DEF_SEC 30 /* seconds */
#define AUFS_MFS_MAX_SEC 3600 /* seconds */ #define AUFS_MFS_MAX_SEC 3600 /* seconds */
#define AUFS_FHSM_CACHE_DEF_SEC 30 /* seconds */
#define AUFS_PLINK_WARN 50 /* number of plinks in a single bucket */ #define AUFS_PLINK_WARN 50 /* number of plinks in a single bucket */
/* pseudo-link maintenace under /proc */ /* pseudo-link maintenace under /proc */
...@@ -113,6 +114,7 @@ typedef int16_t aufs_bindex_t; ...@@ -113,6 +114,7 @@ typedef int16_t aufs_bindex_t;
#define AUFS_BRPERM_RR "rr" #define AUFS_BRPERM_RR "rr"
#define AUFS_BRATTR_COO_REG "coo_reg" #define AUFS_BRATTR_COO_REG "coo_reg"
#define AUFS_BRATTR_COO_ALL "coo_all" #define AUFS_BRATTR_COO_ALL "coo_all"
#define AUFS_BRATTR_FHSM "fhsm"
#define AUFS_BRATTR_ICEX "icex" #define AUFS_BRATTR_ICEX "icex"
#define AUFS_BRATTR_ICEX_SEC "icexsec" #define AUFS_BRATTR_ICEX_SEC "icexsec"
#define AUFS_BRATTR_ICEX_SYS "icexsys" #define AUFS_BRATTR_ICEX_SYS "icexsys"
...@@ -132,6 +134,8 @@ typedef int16_t aufs_bindex_t; ...@@ -132,6 +134,8 @@ typedef int16_t aufs_bindex_t;
#define AuBrAttr_COO_ALL (1 << 4) #define AuBrAttr_COO_ALL (1 << 4)
#define AuBrAttr_COO_Mask (AuBrAttr_COO_REG | AuBrAttr_COO_ALL) #define AuBrAttr_COO_Mask (AuBrAttr_COO_REG | AuBrAttr_COO_ALL)
#define AuBrAttr_FHSM (1 << 5) /* file-based hsm */
/* ignore error in copying XATTR */ /* ignore error in copying XATTR */
#define AuBrAttr_ICEX_SEC (1 << 7) #define AuBrAttr_ICEX_SEC (1 << 7)
#define AuBrAttr_ICEX_SYS (1 << 8) #define AuBrAttr_ICEX_SYS (1 << 8)
...@@ -155,6 +159,10 @@ typedef int16_t aufs_bindex_t; ...@@ -155,6 +159,10 @@ typedef int16_t aufs_bindex_t;
/* #warning test userspace */ /* #warning test userspace */
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef CONFIG_AUFS_FHSM
#undef AuBrAttr_FHSM
#define AuBrAttr_FHSM 0
#endif
#ifndef CONFIG_AUFS_XATTR #ifndef CONFIG_AUFS_XATTR
#undef AuBrAttr_ICEX #undef AuBrAttr_ICEX
#define AuBrAttr_ICEX 0 #define AuBrAttr_ICEX 0
...@@ -174,6 +182,8 @@ typedef int16_t aufs_bindex_t; ...@@ -174,6 +182,8 @@ typedef int16_t aufs_bindex_t;
/* the longest combination */ /* the longest combination */
/* AUFS_BRATTR_ICEX and AUFS_BRATTR_ICEX_TR don't affect here */ /* AUFS_BRATTR_ICEX and AUFS_BRATTR_ICEX_TR don't affect here */
#define AuBrPermStrSz sizeof(AUFS_BRPERM_RW \ #define AuBrPermStrSz sizeof(AUFS_BRPERM_RW \
"+" AUFS_BRATTR_COO_REG \
"+" AUFS_BRATTR_FHSM \
"+" AUFS_BRATTR_ICEX_SEC \ "+" AUFS_BRATTR_ICEX_SEC \
"+" AUFS_BRATTR_ICEX_SYS \ "+" AUFS_BRATTR_ICEX_SYS \
"+" AUFS_BRATTR_ICEX_USR \ "+" AUFS_BRATTR_ICEX_USR \
...@@ -204,6 +214,11 @@ static inline int au_br_cmoo(int brperm) ...@@ -204,6 +214,11 @@ static inline int au_br_cmoo(int brperm)
return brperm & AuBrAttr_CMOO_Mask; return brperm & AuBrAttr_CMOO_Mask;
} }
static inline int au_br_fhsm(int brperm)
{
return brperm & AuBrAttr_FHSM;
}
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
/* ioctl */ /* ioctl */
...@@ -215,7 +230,8 @@ enum { ...@@ -215,7 +230,8 @@ enum {
AuCtl_WBR_FD, /* pathconf wrapper */ AuCtl_WBR_FD, /* pathconf wrapper */
AuCtl_IBUSY, /* busy inode */ AuCtl_IBUSY, /* busy inode */
AuCtl_MVDOWN, /* move-down */ AuCtl_MVDOWN, /* move-down */
AuCtl_BR /* info about branches */ AuCtl_BR, /* info about branches */
AuCtl_FHSM_FD /* connection for fhsm */
}; };
/* borrowed from linux/include/linux/kernel.h */ /* borrowed from linux/include/linux/kernel.h */
...@@ -409,5 +425,6 @@ union aufs_brinfo { ...@@ -409,5 +425,6 @@ union aufs_brinfo {
#define AUFS_CTL_MVDOWN _IOWR(AuCtlType, AuCtl_MVDOWN, \ #define AUFS_CTL_MVDOWN _IOWR(AuCtlType, AuCtl_MVDOWN, \
struct aufs_mvdown) struct aufs_mvdown)
#define AUFS_CTL_BRINFO _IOW(AuCtlType, AuCtl_BR, union aufs_brinfo) #define AUFS_CTL_BRINFO _IOW(AuCtlType, AuCtl_BR, union aufs_brinfo)
#define AUFS_CTL_FHSM_FD _IOW(AuCtlType, AuCtl_FHSM_FD, int)
#endif /* __AUFS_TYPE_H__ */ #endif /* __AUFS_TYPE_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment