hostfs_kern.c (59458f40e25915a355d8b1d701425fe9f4f9ea23) hostfs_kern.c (680b0da9b10d97ddf3c325bf03ae8425ebf4fdec)
1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 *
5 * Ported the filesystem routines to 2.5.
6 * 2003-02-10 Petr Baudis <pasky@ucw.cz>
7 */
8

--- 21 unchanged lines hidden (view full) ---

30 struct inode vfs_inode;
31};
32
33static inline struct hostfs_inode_info *HOSTFS_I(struct inode *inode)
34{
35 return(list_entry(inode, struct hostfs_inode_info, vfs_inode));
36}
37
1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 *
5 * Ported the filesystem routines to 2.5.
6 * 2003-02-10 Petr Baudis <pasky@ucw.cz>
7 */
8

--- 21 unchanged lines hidden (view full) ---

30 struct inode vfs_inode;
31};
32
33static inline struct hostfs_inode_info *HOSTFS_I(struct inode *inode)
34{
35 return(list_entry(inode, struct hostfs_inode_info, vfs_inode));
36}
37
38#define FILE_HOSTFS_I(file) HOSTFS_I((file)->f_dentry->d_inode)
38#define FILE_HOSTFS_I(file) HOSTFS_I((file)->f_path.dentry->d_inode)
39
40int hostfs_d_delete(struct dentry *dentry)
41{
42 return(1);
43}
44
45struct dentry_operations hostfs_dentry_ops = {
46 .d_delete = hostfs_d_delete,

--- 273 unchanged lines hidden (view full) ---

320
321int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
322{
323 void *dir;
324 char *name;
325 unsigned long long next, ino;
326 int error, len;
327
39
40int hostfs_d_delete(struct dentry *dentry)
41{
42 return(1);
43}
44
45struct dentry_operations hostfs_dentry_ops = {
46 .d_delete = hostfs_d_delete,

--- 273 unchanged lines hidden (view full) ---

320
321int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
322{
323 void *dir;
324 char *name;
325 unsigned long long next, ino;
326 int error, len;
327
328 name = dentry_name(file->f_dentry, 0);
328 name = dentry_name(file->f_path.dentry, 0);
329 if(name == NULL) return(-ENOMEM);
330 dir = open_dir(name, &error);
331 kfree(name);
332 if(dir == NULL) return(-error);
333 next = file->f_pos;
334 while((name = read_dir(dir, &next, &ino, &len)) != NULL){
335 error = (*filldir)(ent, name, len, file->f_pos,
336 ino, DT_UNKNOWN);

--- 24 unchanged lines hidden (view full) ---

361 HOSTFS_I(ino)->mode |= mode;
362 if(HOSTFS_I(ino)->mode & FMODE_READ)
363 r = 1;
364 if(HOSTFS_I(ino)->mode & FMODE_WRITE)
365 w = 1;
366 if(w)
367 r = 1;
368
329 if(name == NULL) return(-ENOMEM);
330 dir = open_dir(name, &error);
331 kfree(name);
332 if(dir == NULL) return(-error);
333 next = file->f_pos;
334 while((name = read_dir(dir, &next, &ino, &len)) != NULL){
335 error = (*filldir)(ent, name, len, file->f_pos,
336 ino, DT_UNKNOWN);

--- 24 unchanged lines hidden (view full) ---

361 HOSTFS_I(ino)->mode |= mode;
362 if(HOSTFS_I(ino)->mode & FMODE_READ)
363 r = 1;
364 if(HOSTFS_I(ino)->mode & FMODE_WRITE)
365 w = 1;
366 if(w)
367 r = 1;
368
369 name = dentry_name(file->f_dentry, 0);
369 name = dentry_name(file->f_path.dentry, 0);
370 if(name == NULL)
371 return(-ENOMEM);
372
373 fd = open_file(name, r, w, append);
374 kfree(name);
375 if(fd < 0) return(fd);
376 FILE_HOSTFS_I(file)->fd = fd;
377

--- 654 unchanged lines hidden ---
370 if(name == NULL)
371 return(-ENOMEM);
372
373 fd = open_file(name, r, w, append);
374 kfree(name);
375 if(fd < 0) return(fd);
376 FILE_HOSTFS_I(file)->fd = fd;
377

--- 654 unchanged lines hidden ---