Subversion Repositories shark

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
3
 *
4
 * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
5
 *               Gerardo Lamastra <gerardo@sssup.it>
6
 *
7
 * Authors     : Massimiliano Giorgi <massy@hartik.sssup.it>
8
 * (see authors.txt for full list of hartik's authors)
9
 *
10
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
11
 *
12
 * http://www.sssup.it
13
 * http://retis.sssup.it
14
 * http://hartik.sssup.it
15
 */
16
 
17
/*
18
 * Copyright (C) 1999 Massimiliano Giorgi
19
 *
20
 * This program is free software; you can redistribute it and/or modify
21
 * it under the terms of the GNU General Public License as published by
22
 * the Free Software Foundation; either version 2 of the License, or
23
 * (at your option) any later version.
24
 *
25
 * This program is distributed in the hope that it will be useful,
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
 * GNU General Public License for more details.
29
 *
30
 * You should have received a copy of the GNU General Public License
31
 * along with this program; if not, write to the Free Software
32
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
33
 *
34
 */
35
 
36
/*
37
 * CVS :        $Id: dentry.h,v 1.1.1.1 2002-03-29 14:12:50 pj Exp $
38
 *
39
 * File:        $File$
40
 * Revision:    $Revision: 1.1.1.1 $
41
 * Last update: $Date: 2002-03-29 14:12:50 $
42
 */
43
 
44
/***
45
 The "dentry" structure: it contains a directory entry (only the filename).
46
 ***/
47
 
48
#ifndef __DENTRY_H__
49
#define __DENTRY_H__
50
 
51
#include <fs/limits.h>
52
#include <fs/const.h>
53
#include <fs/types.h>
54
#include <fs/magic.h>
55
 
56
struct qstr {
57
  char name[MAXFILENAMELEN+1];
58
  char *nameptr;
59
};
60
 
61
#define QSTRNAME(ptr) ((ptr)->nameptr!=NULL?(ptr)->nameptr:(ptr)->name)
62
 
63
struct dentry {
64
 
65
  DECLARE_MAGIC(magic);
66
 
67
  struct dentry *d_next;
68
  struct dentry *d_prev;
69
  struct dentry *d_parent;
70
  struct dentry *d_child;
71
 
72
  __time_t       d_acc;
73
  struct qstr    d_name;
74
 
75
  short          d_lock;
76
 
77
  struct dentry_operations  *d_op;
78
  struct inode              *d_inode;
79
  struct super_block        *d_sb;
80
};
81
 
82
int dentry_init(void);
83
int set_root_dentry(struct super_block *sb);
84
struct dentry *get_root_dentry(void);
85
 
86
struct dentry *get_dentry(void);
87
void free_dentry(struct dentry *);
88
void insert_dentry(struct dentry *den, struct dentry *parent);
89
void remove_dentry(struct dentry *den);
90
struct dentry *purge_dentry(void);
91
 
92
int unlink_dentry(struct dentry *den);
93
 
94
int mount_dentry(struct super_block *sb, struct dentry *de);
95
int umount_dentry(struct super_block *sb);
96
 
97
void getfullname_dentry(struct dentry *act, char *buffer, int size);
98
 
99
 
100
/* flags for createflags */
101
#define DENTRY_NOCREATE    0x00
102
#define DENTRY_CANCREATE   0x01
103
#define DENTRY_MUSTCREATE  0x03
104
 
105
#define DENTRY_CREATEMASK  0x03
106
 
107
/* return flags for createflags */
108
#define DENTRY_CREATED     0x01
109
#define DENTRY_EXIST       0x02
110
 
111
struct dentry *find_dentry_from_ext(struct dentry *,
112
                                    char *pathname,
113
                                    int *createflags);
114
void unlock_dentry(struct dentry *den);
115
 
116
extern __inline__ struct dentry *find_dentry_from(struct dentry *den,
117
                                                  char *pathname)
118
{
119
  return find_dentry_from_ext(den,pathname,NULL);
120
}
121
 
122
#endif