Skip to content
Snippets Groups Projects
Commit a5856ed3 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

vfs: provide MAKEIMODE

parent eb55808d
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,10 @@ enum vtype iftovt_tab[16] = {
VNON, VFIFO, VCHR, VNON, VDIR, VNON, VBLK, VNON,
VREG, VNON, VLNK, VNON, VSOCK, VNON, VNON, VBAD,
};
int vttoif_tab[10] = {
0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK,
S_IFSOCK, S_IFIFO, S_IFMT, S_IFMT
};
/*
* Memo:
......
......@@ -196,7 +196,10 @@ int vcount(struct vnode *);
void vflush(struct mount *);
extern enum vtype iftovt_tab[];
extern int vttoif_tab[];
#define IFTOVT(mode) (iftovt_tab[((mode) & S_IFMT) >> 12])
#define VTTOIF(indx) (vttoif_tab[(int)(indx)])
#define MAKEIMODE(indx, mode) (int)(VTTOIF(indx) | (mode))
__END_DECLS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment