Subversion Repositories HelenOS

Rev

Rev 2403 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2403 Rev 2435
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (c) 2006 Martin Decky
2
 * Copyright (c) 2007 Konopa-Jelen-Majer
3
 * All rights reserved.
3
 * All rights reserved.
4
 *
4
 *
5
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
6
 * modification, are permitted provided that the following conditions
7
 * are met:
7
 * are met:
Line 24... Line 24...
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
27
 */
28
 
28
 
29
/** @addtogroup fs
29
/** @addtogroup FileSystemTask
30
 * @{
30
 * @{
31
 */
31
 */
32
 
32
 
33
/**
33
/**
34
 * @file    fs.c
34
 * @file    fs.c
Line 52... Line 52...
52
#include "dir.h"
52
#include "dir.h"
53
#include "../console/console.h"
53
#include "../console/console.h"
54
 
54
 
55
 
55
 
56
static int fs_call;
56
static int fs_call;
57
static ipc_call_t m_input;          /* the input message used for request */
57
static ipc_call_t m_input;          /**< the input message used for request */
58
static ipc_callid_t callid;         /* caller's number */
58
static ipc_callid_t callid;         /**< caller's number */
59
static int new_consument;       /* if new consumer wants to connect to FS */
59
static int new_consument;       /**< if new consumer wants to connect to FS */
60
static int check_con;           /* check of connection of consument */
60
static int check_con;           /**< check of connection of consument */
61
           
61
           
62
static void prepare_message(void);
62
static void prepare_message(void);
63
static int load_super(void);
63
static int load_super(void);
64
static int new_consument_map(void);
64
static int new_consument_map(void);
65
 
65
 
-
 
66
/**
-
 
67
 * Respond to incoming requests from user tasks
-
 
68
 */
66
static void fs_connection(ipc_callid_t iid, ipc_call_t *icall)
69
static void fs_connection(ipc_callid_t iid, ipc_call_t *icall)
67
{
70
{
68
 
71
 
69
    int result = 0;
72
    int result = 0;
70
    ipcarg_t arg = 0;
73
    ipcarg_t arg = 0;
Line 130... Line 133...
130
        ipc_answer_fast(callid, result, arg, 0);
133
        ipc_answer_fast(callid, result, arg, 0);
131
        arg = 0;       
134
        arg = 0;       
132
    }  
135
    }  
133
}
136
}
134
 
137
 
-
 
138
/**
135
/* Extracts parameters from message and prepare them for later usage. */
139
 * Extracts parameters from message and prepare them for later usage.
-
 
140
 */
136
void prepare_message(void)
141
void prepare_message(void)
137
{
142
{
138
   
143
   
139
    int shift, id_task;
144
    int shift, id_task;
140
 
145
 
Line 186... Line 191...
186
   
191
   
187
    /* Unpacking extended input message into message_params structure. */
192
    /* Unpacking extended input message into message_params structure. */
188
    unpack_message(&message_params, m_input, fp->buffer);
193
    unpack_message(&message_params, m_input, fp->buffer);
189
}
194
}
190
 
195
 
-
 
196
/**
191
/* Map some memory to the task */
197
 * Map some memory to the task
-
 
198
 */
192
int new_consument_map()
199
int new_consument_map()
193
{
200
{
194
   
201
   
195
    size_t size;
202
    size_t size;
196
    task_id_t task_id;
203
    task_id_t task_id;
Line 223... Line 230...
223
    }
230
    }
224
 
231
 
225
    return TRUE;
232
    return TRUE;
226
}
233
}
227
 
234
 
-
 
235
/**
228
/* Basic initialization. */
236
 * Basic initialization.
-
 
237
 */
229
static bool fs_init(void)
238
static bool fs_init(void)
230
{
239
{
231
   
240
   
232
    register inode_t *rip;
241
    register inode_t *rip;
233
    int bad, i;
242
    int bad, i;
Line 293... Line 302...
293
    print_console("OK\n");
302
    print_console("OK\n");
294
   
303
   
295
    return TRUE;
304
    return TRUE;
296
}
305
}
297
 
306
 
-
 
307
/**
-
 
308
 * The initialization method for the FS task, it connects to the RD service
-
 
309
 * and then starts the asynchronous request listener for this task.
-
 
310
 */
298
int main(int argc, char **argv)
311
int main(int argc, char **argv)
299
{
312
{
300
   
313
   
301
    int retval, flags;
314
    int retval, flags;
302
    unsigned int size;
315
    unsigned int size;