From: yury Date: Thu, 11 Mar 2004 17:44:12 +0000 (+0000) Subject: Cleanups about readdir stuff. ext2_dirent and macros has moved to lustre_dir.h. Relat... X-Git-Tag: 1.2.2~207 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=55f39fa13a77930592ae87817a440992ae32d859;p=fs%2Flustre-release.git Cleanups about readdir stuff. ext2_dirent and macros has moved to lustre_dir.h. Related chnages in llite and fsfilt_tmpfs.c --- diff --git a/lustre/lvfs/fsfilt_tmpfs.c b/lustre/lvfs/fsfilt_tmpfs.c index 322fa3f..2c78b2d 100644 --- a/lustre/lvfs/fsfilt_tmpfs.c +++ b/lustre/lvfs/fsfilt_tmpfs.c @@ -27,18 +27,14 @@ #include #include -#include #include -#include -#include -#include #include -#include -#include #include #include #include #include +#include +#include /* prefix is needed because tmpfs xattr patch deos not support namespaces * yet. */ @@ -46,7 +42,7 @@ /* structure instance of to be returned as a transaction handle. This is not * needed for now, but probably we will need to save something during modifying - * an inode and this is useful for us. */ + * an inode and this will be useful. */ struct tmpfs_trans { int op; }; @@ -54,23 +50,7 @@ struct tmpfs_trans { static kmem_cache_t *trans_cache; static atomic_t trans_count = ATOMIC_INIT(0); -/* ext2 directory stuff. It is needed for fs_readpage(), which is used for - * reading directoris on MDS. Probably this should be moved to somewhere more - * convenient? */ -#define EXT2_NAME_LEN (255) - -struct ext2_dirent { - __u32 inode; - __u16 rec_len; - __u8 name_len; - __u8 file_type; - char name[0]; -}; - -typedef struct ext2_dirent ext2_dirent_t; - struct fetch_hint { - int stop; int count; __u16 chunk; void *dirent; @@ -80,10 +60,6 @@ struct fetch_hint { typedef struct fetch_hint fetch_hint_t; -#define EXT2_ENT_PAD 4 -#define EXT2_ENT_ROUND (EXT2_ENT_PAD - 1) -#define EXT2_ENT_LEN(len) (((len) + 8 + EXT2_ENT_ROUND) & ~EXT2_ENT_ROUND) - /* starts new transaction on tmpfs for metadata operations. That if for create * file, delete it, etc. That is everything except of read/write data. Returns * pointer to transaction handle to be used later. What we have to do here? @@ -434,7 +410,7 @@ fillent(void *buf, const char *name, int namlen, rec_len = EXT2_ENT_LEN(namlen); - if ((hint->stop = (hint->chunk < rec_len))) + if ((hint->chunk < rec_len)) return -ENOENT; entry->file_type = 0;