| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README | 
|  | 3 | */ | 
|  | 4 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | #include <linux/string.h> | 
|  | 6 | #include <linux/errno.h> | 
|  | 7 | #include <linux/fs.h> | 
|  | 8 | #include <linux/reiserfs_fs.h> | 
|  | 9 | #include <linux/stat.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <linux/buffer_head.h> | 
|  | 11 | #include <asm/uaccess.h> | 
|  | 12 |  | 
| David Woodhouse | 5a1b639 | 2007-05-23 13:57:52 -0700 | [diff] [blame] | 13 | extern const struct reiserfs_key MIN_KEY; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 15 | static int reiserfs_readdir(struct file *, void *, filldir_t); | 
|  | 16 | static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, | 
|  | 17 | int datasync); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 |  | 
| Arjan van de Ven | 4b6f5d2 | 2006-03-28 01:56:42 -0800 | [diff] [blame] | 19 | const struct file_operations reiserfs_dir_operations = { | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 20 | .read = generic_read_dir, | 
|  | 21 | .readdir = reiserfs_readdir, | 
|  | 22 | .fsync = reiserfs_dir_fsync, | 
|  | 23 | .ioctl = reiserfs_ioctl, | 
| David Howells | 52b499c | 2006-08-29 19:06:18 +0100 | [diff] [blame] | 24 | #ifdef CONFIG_COMPAT | 
|  | 25 | .compat_ioctl = reiserfs_compat_ioctl, | 
|  | 26 | #endif | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | }; | 
|  | 28 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 29 | static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, | 
|  | 30 | int datasync) | 
|  | 31 | { | 
|  | 32 | struct inode *inode = dentry->d_inode; | 
|  | 33 | int err; | 
|  | 34 | reiserfs_write_lock(inode->i_sb); | 
|  | 35 | err = reiserfs_commit_for_inode(inode); | 
|  | 36 | reiserfs_write_unlock(inode->i_sb); | 
|  | 37 | if (err < 0) | 
|  | 38 | return err; | 
|  | 39 | return 0; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | } | 
|  | 41 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | #define store_ih(where,what) copy_item_head (where, what) | 
|  | 43 |  | 
| Jeff Mahoney | 677c9b2 | 2009-05-05 15:30:17 -0400 | [diff] [blame] | 44 | static inline bool is_privroot_deh(struct dentry *dir, | 
|  | 45 | struct reiserfs_de_head *deh) | 
|  | 46 | { | 
|  | 47 | int ret = 0; | 
|  | 48 | #ifdef CONFIG_REISERFS_FS_XATTR | 
|  | 49 | struct dentry *privroot = REISERFS_SB(dir->d_sb)->priv_root; | 
|  | 50 | ret = (dir == dir->d_parent && privroot->d_inode && | 
|  | 51 | deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid); | 
|  | 52 | #endif | 
|  | 53 | return ret; | 
|  | 54 | } | 
|  | 55 |  | 
| Jeff Mahoney | a41f1a4 | 2009-03-30 14:02:40 -0400 | [diff] [blame] | 56 | int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent, | 
|  | 57 | filldir_t filldir, loff_t *pos) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | { | 
| Jeff Mahoney | a41f1a4 | 2009-03-30 14:02:40 -0400 | [diff] [blame] | 59 | struct inode *inode = dentry->d_inode; | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 60 | struct cpu_key pos_key;	/* key of current position in the directory (key of directory entry) */ | 
|  | 61 | INITIALIZE_PATH(path_to_entry); | 
|  | 62 | struct buffer_head *bh; | 
|  | 63 | int item_num, entry_num; | 
|  | 64 | const struct reiserfs_key *rkey; | 
|  | 65 | struct item_head *ih, tmp_ih; | 
|  | 66 | int search_res; | 
|  | 67 | char *local_buf; | 
|  | 68 | loff_t next_pos; | 
|  | 69 | char small_buf[32];	/* avoid kmalloc if we can */ | 
|  | 70 | struct reiserfs_dir_entry de; | 
|  | 71 | int ret = 0; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 73 | reiserfs_write_lock(inode->i_sb); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 75 | reiserfs_check_lock_depth(inode->i_sb, "readdir"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 77 | /* form key for search the next directory entry using f_pos field of | 
|  | 78 | file structure */ | 
| Jeff Mahoney | a41f1a4 | 2009-03-30 14:02:40 -0400 | [diff] [blame] | 79 | make_cpu_key(&pos_key, inode, *pos ?: DOT_OFFSET, TYPE_DIRENTRY, 3); | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 80 | next_pos = cpu_key_k_offset(&pos_key); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 82 | path_to_entry.reada = PATH_READA; | 
|  | 83 | while (1) { | 
|  | 84 | research: | 
|  | 85 | /* search the directory item, containing entry with specified key */ | 
|  | 86 | search_res = | 
|  | 87 | search_by_entry_key(inode->i_sb, &pos_key, &path_to_entry, | 
|  | 88 | &de); | 
|  | 89 | if (search_res == IO_ERROR) { | 
|  | 90 | // FIXME: we could just skip part of directory which could | 
|  | 91 | // not be read | 
|  | 92 | ret = -EIO; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | goto out; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | } | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 95 | entry_num = de.de_entry_num; | 
|  | 96 | bh = de.de_bh; | 
|  | 97 | item_num = de.de_item_num; | 
|  | 98 | ih = de.de_ih; | 
|  | 99 | store_ih(&tmp_ih, ih); | 
|  | 100 |  | 
|  | 101 | /* we must have found item, that is item of this directory, */ | 
|  | 102 | RFALSE(COMP_SHORT_KEYS(&(ih->ih_key), &pos_key), | 
|  | 103 | "vs-9000: found item %h does not match to dir we readdir %K", | 
|  | 104 | ih, &pos_key); | 
|  | 105 | RFALSE(item_num > B_NR_ITEMS(bh) - 1, | 
|  | 106 | "vs-9005 item_num == %d, item amount == %d", | 
|  | 107 | item_num, B_NR_ITEMS(bh)); | 
|  | 108 |  | 
|  | 109 | /* and entry must be not more than number of entries in the item */ | 
|  | 110 | RFALSE(I_ENTRY_COUNT(ih) < entry_num, | 
|  | 111 | "vs-9010: entry number is too big %d (%d)", | 
|  | 112 | entry_num, I_ENTRY_COUNT(ih)); | 
|  | 113 |  | 
|  | 114 | if (search_res == POSITION_FOUND | 
|  | 115 | || entry_num < I_ENTRY_COUNT(ih)) { | 
|  | 116 | /* go through all entries in the directory item beginning from the entry, that has been found */ | 
|  | 117 | struct reiserfs_de_head *deh = | 
|  | 118 | B_I_DEH(bh, ih) + entry_num; | 
|  | 119 |  | 
|  | 120 | for (; entry_num < I_ENTRY_COUNT(ih); | 
|  | 121 | entry_num++, deh++) { | 
|  | 122 | int d_reclen; | 
|  | 123 | char *d_name; | 
|  | 124 | off_t d_off; | 
|  | 125 | ino_t d_ino; | 
|  | 126 |  | 
|  | 127 | if (!de_visible(deh)) | 
|  | 128 | /* it is hidden entry */ | 
|  | 129 | continue; | 
|  | 130 | d_reclen = entry_length(bh, ih, entry_num); | 
|  | 131 | d_name = B_I_DEH_ENTRY_FILE_NAME(bh, ih, deh); | 
| Lepton Wu | 80eb68d | 2007-10-16 23:29:50 -0700 | [diff] [blame] | 132 |  | 
|  | 133 | if (d_reclen <= 0 || | 
|  | 134 | d_name + d_reclen > bh->b_data + bh->b_size) { | 
|  | 135 | /* There is corrupted data in entry, | 
|  | 136 | * We'd better stop here */ | 
|  | 137 | pathrelse(&path_to_entry); | 
|  | 138 | ret = -EIO; | 
|  | 139 | goto out; | 
|  | 140 | } | 
|  | 141 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 142 | if (!d_name[d_reclen - 1]) | 
|  | 143 | d_reclen = strlen(d_name); | 
|  | 144 |  | 
|  | 145 | if (d_reclen > | 
|  | 146 | REISERFS_MAX_NAME(inode->i_sb-> | 
|  | 147 | s_blocksize)) { | 
|  | 148 | /* too big to send back to VFS */ | 
|  | 149 | continue; | 
|  | 150 | } | 
|  | 151 |  | 
|  | 152 | /* Ignore the .reiserfs_priv entry */ | 
| Jeff Mahoney | 677c9b2 | 2009-05-05 15:30:17 -0400 | [diff] [blame] | 153 | if (is_privroot_deh(dentry, deh)) | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 154 | continue; | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 155 |  | 
|  | 156 | d_off = deh_offset(deh); | 
| Jeff Mahoney | a41f1a4 | 2009-03-30 14:02:40 -0400 | [diff] [blame] | 157 | *pos = d_off; | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 158 | d_ino = deh_objectid(deh); | 
|  | 159 | if (d_reclen <= 32) { | 
|  | 160 | local_buf = small_buf; | 
|  | 161 | } else { | 
| Pekka Enberg | d739b42 | 2006-02-01 03:06:43 -0800 | [diff] [blame] | 162 | local_buf = kmalloc(d_reclen, | 
|  | 163 | GFP_NOFS); | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 164 | if (!local_buf) { | 
|  | 165 | pathrelse(&path_to_entry); | 
|  | 166 | ret = -ENOMEM; | 
|  | 167 | goto out; | 
|  | 168 | } | 
|  | 169 | if (item_moved(&tmp_ih, &path_to_entry)) { | 
| Pekka Enberg | d739b42 | 2006-02-01 03:06:43 -0800 | [diff] [blame] | 170 | kfree(local_buf); | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 171 | goto research; | 
|  | 172 | } | 
|  | 173 | } | 
|  | 174 | // Note, that we copy name to user space via temporary | 
|  | 175 | // buffer (local_buf) because filldir will block if | 
|  | 176 | // user space buffer is swapped out. At that time | 
|  | 177 | // entry can move to somewhere else | 
|  | 178 | memcpy(local_buf, d_name, d_reclen); | 
|  | 179 | if (filldir | 
|  | 180 | (dirent, local_buf, d_reclen, d_off, d_ino, | 
|  | 181 | DT_UNKNOWN) < 0) { | 
|  | 182 | if (local_buf != small_buf) { | 
| Pekka Enberg | d739b42 | 2006-02-01 03:06:43 -0800 | [diff] [blame] | 183 | kfree(local_buf); | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 184 | } | 
|  | 185 | goto end; | 
|  | 186 | } | 
|  | 187 | if (local_buf != small_buf) { | 
| Pekka Enberg | d739b42 | 2006-02-01 03:06:43 -0800 | [diff] [blame] | 188 | kfree(local_buf); | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 189 | } | 
|  | 190 | // next entry should be looked for with such offset | 
|  | 191 | next_pos = deh_offset(deh) + 1; | 
|  | 192 |  | 
|  | 193 | if (item_moved(&tmp_ih, &path_to_entry)) { | 
|  | 194 | goto research; | 
|  | 195 | } | 
|  | 196 | }	/* for */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | } | 
|  | 198 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 199 | if (item_num != B_NR_ITEMS(bh) - 1) | 
|  | 200 | // end of directory has been reached | 
|  | 201 | goto end; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 203 | /* item we went through is last item of node. Using right | 
|  | 204 | delimiting key check is it directory end */ | 
|  | 205 | rkey = get_rkey(&path_to_entry, inode->i_sb); | 
|  | 206 | if (!comp_le_keys(rkey, &MIN_KEY)) { | 
|  | 207 | /* set pos_key to key, that is the smallest and greater | 
|  | 208 | that key of the last entry in the item */ | 
|  | 209 | set_cpu_key_k_offset(&pos_key, next_pos); | 
|  | 210 | continue; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 211 | } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 213 | if (COMP_SHORT_KEYS(rkey, &pos_key)) { | 
|  | 214 | // end of directory has been reached | 
|  | 215 | goto end; | 
|  | 216 | } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 218 | /* directory continues in the right neighboring block */ | 
|  | 219 | set_cpu_key_k_offset(&pos_key, | 
|  | 220 | le_key_k_offset(KEY_FORMAT_3_5, rkey)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 222 | }			/* while */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 223 |  | 
| Jeff Mahoney | a41f1a4 | 2009-03-30 14:02:40 -0400 | [diff] [blame] | 224 | end: | 
|  | 225 | *pos = next_pos; | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 226 | pathrelse(&path_to_entry); | 
|  | 227 | reiserfs_check_path(&path_to_entry); | 
| Jeff Mahoney | a41f1a4 | 2009-03-30 14:02:40 -0400 | [diff] [blame] | 228 | out: | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 229 | reiserfs_write_unlock(inode->i_sb); | 
|  | 230 | return ret; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | } | 
|  | 232 |  | 
| Jeff Mahoney | a41f1a4 | 2009-03-30 14:02:40 -0400 | [diff] [blame] | 233 | static int reiserfs_readdir(struct file *file, void *dirent, filldir_t filldir) | 
|  | 234 | { | 
|  | 235 | struct dentry *dentry = file->f_path.dentry; | 
|  | 236 | return reiserfs_readdir_dentry(dentry, dirent, filldir, &file->f_pos); | 
|  | 237 | } | 
|  | 238 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | /* compose directory item containing "." and ".." entries (entries are | 
|  | 240 | not aligned to 4 byte boundary) */ | 
|  | 241 | /* the last four params are LE */ | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 242 | void make_empty_dir_item_v1(char *body, __le32 dirid, __le32 objid, | 
|  | 243 | __le32 par_dirid, __le32 par_objid) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | { | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 245 | struct reiserfs_de_head *deh; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 247 | memset(body, 0, EMPTY_DIR_SIZE_V1); | 
|  | 248 | deh = (struct reiserfs_de_head *)body; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 250 | /* direntry header of "." */ | 
|  | 251 | put_deh_offset(&(deh[0]), DOT_OFFSET); | 
|  | 252 | /* these two are from make_le_item_head, and are are LE */ | 
|  | 253 | deh[0].deh_dir_id = dirid; | 
|  | 254 | deh[0].deh_objectid = objid; | 
|  | 255 | deh[0].deh_state = 0;	/* Endian safe if 0 */ | 
|  | 256 | put_deh_location(&(deh[0]), EMPTY_DIR_SIZE_V1 - strlen(".")); | 
|  | 257 | mark_de_visible(&(deh[0])); | 
|  | 258 |  | 
|  | 259 | /* direntry header of ".." */ | 
|  | 260 | put_deh_offset(&(deh[1]), DOT_DOT_OFFSET); | 
|  | 261 | /* key of ".." for the root directory */ | 
|  | 262 | /* these two are from the inode, and are are LE */ | 
|  | 263 | deh[1].deh_dir_id = par_dirid; | 
|  | 264 | deh[1].deh_objectid = par_objid; | 
|  | 265 | deh[1].deh_state = 0;	/* Endian safe if 0 */ | 
|  | 266 | put_deh_location(&(deh[1]), deh_location(&(deh[0])) - strlen("..")); | 
|  | 267 | mark_de_visible(&(deh[1])); | 
|  | 268 |  | 
|  | 269 | /* copy ".." and "." */ | 
|  | 270 | memcpy(body + deh_location(&(deh[0])), ".", 1); | 
|  | 271 | memcpy(body + deh_location(&(deh[1])), "..", 2); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | } | 
|  | 273 |  | 
|  | 274 | /* compose directory item containing "." and ".." entries */ | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 275 | void make_empty_dir_item(char *body, __le32 dirid, __le32 objid, | 
|  | 276 | __le32 par_dirid, __le32 par_objid) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | { | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 278 | struct reiserfs_de_head *deh; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 280 | memset(body, 0, EMPTY_DIR_SIZE); | 
|  | 281 | deh = (struct reiserfs_de_head *)body; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 |  | 
| Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 283 | /* direntry header of "." */ | 
|  | 284 | put_deh_offset(&(deh[0]), DOT_OFFSET); | 
|  | 285 | /* these two are from make_le_item_head, and are are LE */ | 
|  | 286 | deh[0].deh_dir_id = dirid; | 
|  | 287 | deh[0].deh_objectid = objid; | 
|  | 288 | deh[0].deh_state = 0;	/* Endian safe if 0 */ | 
|  | 289 | put_deh_location(&(deh[0]), EMPTY_DIR_SIZE - ROUND_UP(strlen("."))); | 
|  | 290 | mark_de_visible(&(deh[0])); | 
|  | 291 |  | 
|  | 292 | /* direntry header of ".." */ | 
|  | 293 | put_deh_offset(&(deh[1]), DOT_DOT_OFFSET); | 
|  | 294 | /* key of ".." for the root directory */ | 
|  | 295 | /* these two are from the inode, and are are LE */ | 
|  | 296 | deh[1].deh_dir_id = par_dirid; | 
|  | 297 | deh[1].deh_objectid = par_objid; | 
|  | 298 | deh[1].deh_state = 0;	/* Endian safe if 0 */ | 
|  | 299 | put_deh_location(&(deh[1]), | 
|  | 300 | deh_location(&(deh[0])) - ROUND_UP(strlen(".."))); | 
|  | 301 | mark_de_visible(&(deh[1])); | 
|  | 302 |  | 
|  | 303 | /* copy ".." and "." */ | 
|  | 304 | memcpy(body + deh_location(&(deh[0])), ".", 1); | 
|  | 305 | memcpy(body + deh_location(&(deh[1])), "..", 2); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 306 | } |