Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/fs/hfs/dir.c |
| 3 | * |
| 4 | * Copyright (C) 1995-1997 Paul H. Hargrove |
| 5 | * (C) 2003 Ardis Technologies <roman@ardistech.com> |
| 6 | * This file may be distributed under the terms of the GNU General Public License. |
| 7 | * |
| 8 | * This file contains directory-related functions independent of which |
| 9 | * scheme is being used to represent forks. |
| 10 | * |
| 11 | * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds |
| 12 | */ |
| 13 | |
| 14 | #include "hfs_fs.h" |
| 15 | #include "btree.h" |
| 16 | |
| 17 | /* |
| 18 | * hfs_lookup() |
| 19 | */ |
| 20 | static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry, |
Al Viro | 00cd8dd | 2012-06-10 17:13:09 -0400 | [diff] [blame] | 21 | unsigned int flags) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | { |
| 23 | hfs_cat_rec rec; |
| 24 | struct hfs_find_data fd; |
| 25 | struct inode *inode = NULL; |
| 26 | int res; |
| 27 | |
Alexey Khoroshilov | 9509f17 | 2013-04-30 15:27:52 -0700 | [diff] [blame] | 28 | res = hfs_find_init(HFS_SB(dir->i_sb)->cat_tree, &fd); |
| 29 | if (res) |
| 30 | return ERR_PTR(res); |
Roman Zippel | 328b922 | 2005-09-06 15:18:49 -0700 | [diff] [blame] | 31 | hfs_cat_build_key(dir->i_sb, fd.search_key, dir->i_ino, &dentry->d_name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | res = hfs_brec_read(&fd, &rec, sizeof(rec)); |
| 33 | if (res) { |
| 34 | hfs_find_exit(&fd); |
| 35 | if (res == -ENOENT) { |
| 36 | /* No such entry */ |
| 37 | inode = NULL; |
| 38 | goto done; |
| 39 | } |
| 40 | return ERR_PTR(res); |
| 41 | } |
| 42 | inode = hfs_iget(dir->i_sb, &fd.search_key->cat, &rec); |
| 43 | hfs_find_exit(&fd); |
| 44 | if (!inode) |
| 45 | return ERR_PTR(-EACCES); |
| 46 | done: |
| 47 | d_add(dentry, inode); |
| 48 | return NULL; |
| 49 | } |
| 50 | |
| 51 | /* |
| 52 | * hfs_readdir |
| 53 | */ |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 54 | static int hfs_readdir(struct file *file, struct dir_context *ctx) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | { |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 56 | struct inode *inode = file_inode(file); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | struct super_block *sb = inode->i_sb; |
| 58 | int len, err; |
Roman Zippel | 328b922 | 2005-09-06 15:18:49 -0700 | [diff] [blame] | 59 | char strbuf[HFS_MAX_NAMELEN]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | union hfs_cat_rec entry; |
| 61 | struct hfs_find_data fd; |
| 62 | struct hfs_readdir_data *rd; |
| 63 | u16 type; |
| 64 | |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 65 | if (ctx->pos >= inode->i_size) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | return 0; |
| 67 | |
Alexey Khoroshilov | 9509f17 | 2013-04-30 15:27:52 -0700 | [diff] [blame] | 68 | err = hfs_find_init(HFS_SB(sb)->cat_tree, &fd); |
| 69 | if (err) |
| 70 | return err; |
Roman Zippel | 328b922 | 2005-09-06 15:18:49 -0700 | [diff] [blame] | 71 | hfs_cat_build_key(sb, fd.search_key, inode->i_ino, NULL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | err = hfs_brec_find(&fd); |
| 73 | if (err) |
| 74 | goto out; |
| 75 | |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 76 | if (ctx->pos == 0) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | /* This is completely artificial... */ |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 78 | if (!dir_emit_dot(file, ctx)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | goto out; |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 80 | ctx->pos = 1; |
| 81 | } |
| 82 | if (ctx->pos == 1) { |
Amerigo Wang | ec81aec | 2009-12-14 17:57:37 -0800 | [diff] [blame] | 83 | if (fd.entrylength > sizeof(entry) || fd.entrylength < 0) { |
| 84 | err = -EIO; |
| 85 | goto out; |
| 86 | } |
| 87 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); |
| 89 | if (entry.type != HFS_CDR_THD) { |
Joe Perches | d614267 | 2013-04-30 15:27:55 -0700 | [diff] [blame] | 90 | pr_err("bad catalog folder thread\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | err = -EIO; |
| 92 | goto out; |
| 93 | } |
| 94 | //if (fd.entrylength < HFS_MIN_THREAD_SZ) { |
Joe Perches | d614267 | 2013-04-30 15:27:55 -0700 | [diff] [blame] | 95 | // pr_err("truncated catalog thread\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | // err = -EIO; |
| 97 | // goto out; |
| 98 | //} |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 99 | if (!dir_emit(ctx, "..", 2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | be32_to_cpu(entry.thread.ParID), DT_DIR)) |
| 101 | goto out; |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 102 | ctx->pos = 2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | } |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 104 | if (ctx->pos >= inode->i_size) |
| 105 | goto out; |
| 106 | err = hfs_brec_goto(&fd, ctx->pos - 1); |
| 107 | if (err) |
| 108 | goto out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | |
| 110 | for (;;) { |
| 111 | if (be32_to_cpu(fd.key->cat.ParID) != inode->i_ino) { |
Joe Perches | d614267 | 2013-04-30 15:27:55 -0700 | [diff] [blame] | 112 | pr_err("walked past end of dir\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 113 | err = -EIO; |
| 114 | goto out; |
| 115 | } |
Amerigo Wang | ec81aec | 2009-12-14 17:57:37 -0800 | [diff] [blame] | 116 | |
| 117 | if (fd.entrylength > sizeof(entry) || fd.entrylength < 0) { |
| 118 | err = -EIO; |
| 119 | goto out; |
| 120 | } |
| 121 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); |
| 123 | type = entry.type; |
Roman Zippel | 328b922 | 2005-09-06 15:18:49 -0700 | [diff] [blame] | 124 | len = hfs_mac2asc(sb, strbuf, &fd.key->cat.CName); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | if (type == HFS_CDR_DIR) { |
| 126 | if (fd.entrylength < sizeof(struct hfs_cat_dir)) { |
Joe Perches | d614267 | 2013-04-30 15:27:55 -0700 | [diff] [blame] | 127 | pr_err("small dir entry\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | err = -EIO; |
| 129 | goto out; |
| 130 | } |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 131 | if (!dir_emit(ctx, strbuf, len, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | be32_to_cpu(entry.dir.DirID), DT_DIR)) |
| 133 | break; |
| 134 | } else if (type == HFS_CDR_FIL) { |
| 135 | if (fd.entrylength < sizeof(struct hfs_cat_file)) { |
Joe Perches | d614267 | 2013-04-30 15:27:55 -0700 | [diff] [blame] | 136 | pr_err("small file entry\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 | err = -EIO; |
| 138 | goto out; |
| 139 | } |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 140 | if (!dir_emit(ctx, strbuf, len, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | be32_to_cpu(entry.file.FlNum), DT_REG)) |
| 142 | break; |
| 143 | } else { |
Joe Perches | d614267 | 2013-04-30 15:27:55 -0700 | [diff] [blame] | 144 | pr_err("bad catalog entry type %d\n", type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | err = -EIO; |
| 146 | goto out; |
| 147 | } |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 148 | ctx->pos++; |
| 149 | if (ctx->pos >= inode->i_size) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 150 | goto out; |
| 151 | err = hfs_brec_goto(&fd, 1); |
| 152 | if (err) |
| 153 | goto out; |
| 154 | } |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 155 | rd = file->private_data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 156 | if (!rd) { |
| 157 | rd = kmalloc(sizeof(struct hfs_readdir_data), GFP_KERNEL); |
| 158 | if (!rd) { |
| 159 | err = -ENOMEM; |
| 160 | goto out; |
| 161 | } |
Al Viro | 002f8be | 2013-05-22 14:29:35 -0400 | [diff] [blame] | 162 | file->private_data = rd; |
| 163 | rd->file = file; |
Al Viro | 9717a91 | 2016-05-12 20:13:50 -0400 | [diff] [blame] | 164 | spin_lock(&HFS_I(inode)->open_dir_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | list_add(&rd->list, &HFS_I(inode)->open_dir_list); |
Al Viro | 9717a91 | 2016-05-12 20:13:50 -0400 | [diff] [blame] | 166 | spin_unlock(&HFS_I(inode)->open_dir_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 167 | } |
Al Viro | 9717a91 | 2016-05-12 20:13:50 -0400 | [diff] [blame] | 168 | /* |
| 169 | * Can be done after the list insertion; exclusion with |
| 170 | * hfs_delete_cat() is provided by directory lock. |
| 171 | */ |
Dan Carpenter | eec1153 | 2017-01-18 14:13:20 +0300 | [diff] [blame] | 172 | memcpy(&rd->key, &fd.key->cat, sizeof(struct hfs_cat_key)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 173 | out: |
| 174 | hfs_find_exit(&fd); |
| 175 | return err; |
| 176 | } |
| 177 | |
| 178 | static int hfs_dir_release(struct inode *inode, struct file *file) |
| 179 | { |
| 180 | struct hfs_readdir_data *rd = file->private_data; |
| 181 | if (rd) { |
Al Viro | 9717a91 | 2016-05-12 20:13:50 -0400 | [diff] [blame] | 182 | spin_lock(&HFS_I(inode)->open_dir_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | list_del(&rd->list); |
Al Viro | 9717a91 | 2016-05-12 20:13:50 -0400 | [diff] [blame] | 184 | spin_unlock(&HFS_I(inode)->open_dir_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | kfree(rd); |
| 186 | } |
| 187 | return 0; |
| 188 | } |
| 189 | |
| 190 | /* |
| 191 | * hfs_create() |
| 192 | * |
| 193 | * This is the create() entry in the inode_operations structure for |
| 194 | * regular HFS directories. The purpose is to create a new file in |
| 195 | * a directory and return a corresponding inode, given the inode for |
| 196 | * the directory and the name (and its length) of the new file. |
| 197 | */ |
Al Viro | 4acdaf2 | 2011-07-26 01:42:34 -0400 | [diff] [blame] | 198 | static int hfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, |
Al Viro | ebfc3b4 | 2012-06-10 18:05:36 -0400 | [diff] [blame] | 199 | bool excl) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | { |
| 201 | struct inode *inode; |
| 202 | int res; |
| 203 | |
| 204 | inode = hfs_new_inode(dir, &dentry->d_name, mode); |
| 205 | if (!inode) |
Chengyu Song | 13f2448 | 2015-04-16 12:46:53 -0700 | [diff] [blame] | 206 | return -ENOMEM; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 207 | |
| 208 | res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode); |
| 209 | if (res) { |
Miklos Szeredi | 6d6b77f | 2011-10-28 14:13:28 +0200 | [diff] [blame] | 210 | clear_nlink(inode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 211 | hfs_delete_inode(inode); |
| 212 | iput(inode); |
| 213 | return res; |
| 214 | } |
| 215 | d_instantiate(dentry, inode); |
| 216 | mark_inode_dirty(inode); |
| 217 | return 0; |
| 218 | } |
| 219 | |
| 220 | /* |
| 221 | * hfs_mkdir() |
| 222 | * |
| 223 | * This is the mkdir() entry in the inode_operations structure for |
| 224 | * regular HFS directories. The purpose is to create a new directory |
| 225 | * in a directory, given the inode for the parent directory and the |
| 226 | * name (and its length) of the new directory. |
| 227 | */ |
Al Viro | 18bb1db | 2011-07-26 01:41:39 -0400 | [diff] [blame] | 228 | static int hfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 229 | { |
| 230 | struct inode *inode; |
| 231 | int res; |
| 232 | |
| 233 | inode = hfs_new_inode(dir, &dentry->d_name, S_IFDIR | mode); |
| 234 | if (!inode) |
Chengyu Song | 13f2448 | 2015-04-16 12:46:53 -0700 | [diff] [blame] | 235 | return -ENOMEM; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | |
| 237 | res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode); |
| 238 | if (res) { |
Miklos Szeredi | 6d6b77f | 2011-10-28 14:13:28 +0200 | [diff] [blame] | 239 | clear_nlink(inode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | hfs_delete_inode(inode); |
| 241 | iput(inode); |
| 242 | return res; |
| 243 | } |
| 244 | d_instantiate(dentry, inode); |
| 245 | mark_inode_dirty(inode); |
| 246 | return 0; |
| 247 | } |
| 248 | |
| 249 | /* |
Al Viro | 69102e9 | 2011-03-02 23:46:51 -0500 | [diff] [blame] | 250 | * hfs_remove() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | * |
Al Viro | 69102e9 | 2011-03-02 23:46:51 -0500 | [diff] [blame] | 252 | * This serves as both unlink() and rmdir() in the inode_operations |
| 253 | * structure for regular HFS directories. The purpose is to delete |
| 254 | * an existing child, given the inode for the parent directory and |
| 255 | * the name (and its length) of the existing directory. |
| 256 | * |
| 257 | * HFS does not have hardlinks, so both rmdir and unlink set the |
| 258 | * link count to 0. The only difference is the emptiness check. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | */ |
Al Viro | 69102e9 | 2011-03-02 23:46:51 -0500 | [diff] [blame] | 260 | static int hfs_remove(struct inode *dir, struct dentry *dentry) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | { |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 262 | struct inode *inode = d_inode(dentry); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 263 | int res; |
| 264 | |
Al Viro | 69102e9 | 2011-03-02 23:46:51 -0500 | [diff] [blame] | 265 | if (S_ISDIR(inode->i_mode) && inode->i_size != 2) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | return -ENOTEMPTY; |
| 267 | res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name); |
| 268 | if (res) |
| 269 | return res; |
Dave Hansen | ce71ec3 | 2006-09-30 23:29:06 -0700 | [diff] [blame] | 270 | clear_nlink(inode); |
Deepa Dinamani | 02027d4 | 2016-09-14 07:48:05 -0700 | [diff] [blame] | 271 | inode->i_ctime = current_time(inode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | hfs_delete_inode(inode); |
| 273 | mark_inode_dirty(inode); |
| 274 | return 0; |
| 275 | } |
| 276 | |
| 277 | /* |
| 278 | * hfs_rename() |
| 279 | * |
| 280 | * This is the rename() entry in the inode_operations structure for |
| 281 | * regular HFS directories. The purpose is to rename an existing |
| 282 | * file or directory, given the inode for the current directory and |
| 283 | * the name (and its length) of the existing file/directory and the |
| 284 | * inode for the new directory and the name (and its length) of the |
| 285 | * new file/directory. |
| 286 | * XXX: how do you handle must_be dir? |
| 287 | */ |
| 288 | static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry, |
Miklos Szeredi | f03b8ad | 2016-09-27 11:03:57 +0200 | [diff] [blame] | 289 | struct inode *new_dir, struct dentry *new_dentry, |
| 290 | unsigned int flags) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 291 | { |
| 292 | int res; |
| 293 | |
Miklos Szeredi | f03b8ad | 2016-09-27 11:03:57 +0200 | [diff] [blame] | 294 | if (flags & ~RENAME_NOREPLACE) |
| 295 | return -EINVAL; |
| 296 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 297 | /* Unlink destination if it already exists */ |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 298 | if (d_really_is_positive(new_dentry)) { |
Al Viro | 69102e9 | 2011-03-02 23:46:51 -0500 | [diff] [blame] | 299 | res = hfs_remove(new_dir, new_dentry); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | if (res) |
| 301 | return res; |
| 302 | } |
| 303 | |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 304 | res = hfs_cat_move(d_inode(old_dentry)->i_ino, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | old_dir, &old_dentry->d_name, |
| 306 | new_dir, &new_dentry->d_name); |
| 307 | if (!res) |
Roman Zippel | 328b922 | 2005-09-06 15:18:49 -0700 | [diff] [blame] | 308 | hfs_cat_build_key(old_dir->i_sb, |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 309 | (btree_key *)&HFS_I(d_inode(old_dentry))->cat_key, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 310 | new_dir->i_ino, &new_dentry->d_name); |
| 311 | return res; |
| 312 | } |
| 313 | |
Arjan van de Ven | 4b6f5d2 | 2006-03-28 01:56:42 -0800 | [diff] [blame] | 314 | const struct file_operations hfs_dir_operations = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 315 | .read = generic_read_dir, |
Al Viro | 9717a91 | 2016-05-12 20:13:50 -0400 | [diff] [blame] | 316 | .iterate_shared = hfs_readdir, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 317 | .llseek = generic_file_llseek, |
| 318 | .release = hfs_dir_release, |
| 319 | }; |
| 320 | |
Arjan van de Ven | 92e1d5b | 2007-02-12 00:55:39 -0800 | [diff] [blame] | 321 | const struct inode_operations hfs_dir_inode_operations = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | .create = hfs_create, |
| 323 | .lookup = hfs_lookup, |
Al Viro | 69102e9 | 2011-03-02 23:46:51 -0500 | [diff] [blame] | 324 | .unlink = hfs_remove, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 325 | .mkdir = hfs_mkdir, |
Al Viro | 69102e9 | 2011-03-02 23:46:51 -0500 | [diff] [blame] | 326 | .rmdir = hfs_remove, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 327 | .rename = hfs_rename, |
| 328 | .setattr = hfs_inode_setattr, |
| 329 | }; |