Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/fs/hpfs/namei.c |
| 3 | * |
| 4 | * Mikulas Patocka (mikulas@artax.karlin.mff.cuni.cz), 1998-1999 |
| 5 | * |
| 6 | * adding & removing files & directories |
| 7 | */ |
Alexey Dobriyan | e8edc6e | 2007-05-21 01:22:52 +0400 | [diff] [blame] | 8 | #include <linux/sched.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #include "hpfs_fn.h" |
| 10 | |
| 11 | static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) |
| 12 | { |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 13 | const unsigned char *name = dentry->d_name.name; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | unsigned len = dentry->d_name.len; |
| 15 | struct quad_buffer_head qbh0; |
| 16 | struct buffer_head *bh; |
| 17 | struct hpfs_dirent *de; |
| 18 | struct fnode *fnode; |
| 19 | struct dnode *dnode; |
| 20 | struct inode *result; |
| 21 | fnode_secno fno; |
| 22 | dnode_secno dno; |
| 23 | int r; |
| 24 | struct hpfs_dirent dee; |
| 25 | int err; |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 26 | if ((err = hpfs_chk_name(name, &len))) return err==-ENOENT ? -EINVAL : err; |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 27 | hpfs_lock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | err = -ENOSPC; |
| 29 | fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); |
| 30 | if (!fnode) |
| 31 | goto bail; |
Mikulas Patocka | 7d23ce3 | 2011-05-08 20:43:06 +0200 | [diff] [blame] | 32 | dnode = hpfs_alloc_dnode(dir->i_sb, fno, &dno, &qbh0); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | if (!dnode) |
| 34 | goto bail1; |
| 35 | memset(&dee, 0, sizeof dee); |
| 36 | dee.directory = 1; |
| 37 | if (!(mode & 0222)) dee.read_only = 1; |
| 38 | /*dee.archive = 0;*/ |
| 39 | dee.hidden = name[0] == '.'; |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 40 | dee.fnode = cpu_to_le32(fno); |
| 41 | dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | result = new_inode(dir->i_sb); |
| 43 | if (!result) |
| 44 | goto bail2; |
| 45 | hpfs_init_inode(result); |
| 46 | result->i_ino = fno; |
| 47 | hpfs_i(result)->i_parent_dir = dir->i_ino; |
| 48 | hpfs_i(result)->i_dno = dno; |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 49 | result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | result->i_ctime.tv_nsec = 0; |
| 51 | result->i_mtime.tv_nsec = 0; |
| 52 | result->i_atime.tv_nsec = 0; |
| 53 | hpfs_i(result)->i_ea_size = 0; |
| 54 | result->i_mode |= S_IFDIR; |
| 55 | result->i_op = &hpfs_dir_iops; |
| 56 | result->i_fop = &hpfs_dir_ops; |
| 57 | result->i_blocks = 4; |
| 58 | result->i_size = 2048; |
| 59 | result->i_nlink = 2; |
| 60 | if (dee.read_only) |
| 61 | result->i_mode &= ~0222; |
| 62 | |
Mikulas Patocka | 7d23ce3 | 2011-05-08 20:43:06 +0200 | [diff] [blame] | 63 | r = hpfs_add_dirent(dir, name, len, &dee); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | if (r == 1) |
| 65 | goto bail3; |
| 66 | if (r == -1) { |
| 67 | err = -EEXIST; |
| 68 | goto bail3; |
| 69 | } |
| 70 | fnode->len = len; |
| 71 | memcpy(fnode->name, name, len > 15 ? 15 : len); |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 72 | fnode->up = cpu_to_le32(dir->i_ino); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | fnode->dirflag = 1; |
| 74 | fnode->btree.n_free_nodes = 7; |
| 75 | fnode->btree.n_used_nodes = 1; |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 76 | fnode->btree.first_free = cpu_to_le16(0x14); |
| 77 | fnode->u.external[0].disk_secno = cpu_to_le32(dno); |
| 78 | fnode->u.external[0].file_secno = cpu_to_le32(-1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | dnode->root_dnode = 1; |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 80 | dnode->up = cpu_to_le32(fno); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | de = hpfs_add_de(dir->i_sb, dnode, "\001\001", 2, 0); |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 82 | de->creation_date = de->write_date = de->read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | if (!(mode & 0222)) de->read_only = 1; |
| 84 | de->first = de->directory = 1; |
| 85 | /*de->hidden = de->system = 0;*/ |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 86 | de->fnode = cpu_to_le32(fno); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | mark_buffer_dirty(bh); |
| 88 | brelse(bh); |
| 89 | hpfs_mark_4buffers_dirty(&qbh0); |
| 90 | hpfs_brelse4(&qbh0); |
Dave Hansen | d8c76e6 | 2006-09-30 23:29:04 -0700 | [diff] [blame] | 91 | inc_nlink(dir); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | insert_inode_hash(result); |
| 93 | |
David Howells | de395b8 | 2008-11-14 10:38:55 +1100 | [diff] [blame] | 94 | if (result->i_uid != current_fsuid() || |
| 95 | result->i_gid != current_fsgid() || |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | result->i_mode != (mode | S_IFDIR)) { |
David Howells | de395b8 | 2008-11-14 10:38:55 +1100 | [diff] [blame] | 97 | result->i_uid = current_fsuid(); |
| 98 | result->i_gid = current_fsgid(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | result->i_mode = mode | S_IFDIR; |
| 100 | hpfs_write_inode_nolock(result); |
| 101 | } |
| 102 | d_instantiate(dentry, result); |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 103 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | return 0; |
| 105 | bail3: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | iput(result); |
| 107 | bail2: |
| 108 | hpfs_brelse4(&qbh0); |
| 109 | hpfs_free_dnode(dir->i_sb, dno); |
| 110 | bail1: |
| 111 | brelse(bh); |
| 112 | hpfs_free_sectors(dir->i_sb, fno, 1); |
| 113 | bail: |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 114 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | return err; |
| 116 | } |
| 117 | |
| 118 | static int hpfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd) |
| 119 | { |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 120 | const unsigned char *name = dentry->d_name.name; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | unsigned len = dentry->d_name.len; |
| 122 | struct inode *result = NULL; |
| 123 | struct buffer_head *bh; |
| 124 | struct fnode *fnode; |
| 125 | fnode_secno fno; |
| 126 | int r; |
| 127 | struct hpfs_dirent dee; |
| 128 | int err; |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 129 | if ((err = hpfs_chk_name(name, &len))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | return err==-ENOENT ? -EINVAL : err; |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 131 | hpfs_lock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | err = -ENOSPC; |
| 133 | fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); |
| 134 | if (!fnode) |
| 135 | goto bail; |
| 136 | memset(&dee, 0, sizeof dee); |
| 137 | if (!(mode & 0222)) dee.read_only = 1; |
| 138 | dee.archive = 1; |
| 139 | dee.hidden = name[0] == '.'; |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 140 | dee.fnode = cpu_to_le32(fno); |
| 141 | dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | |
| 143 | result = new_inode(dir->i_sb); |
| 144 | if (!result) |
| 145 | goto bail1; |
| 146 | |
| 147 | hpfs_init_inode(result); |
| 148 | result->i_ino = fno; |
| 149 | result->i_mode |= S_IFREG; |
| 150 | result->i_mode &= ~0111; |
| 151 | result->i_op = &hpfs_file_iops; |
| 152 | result->i_fop = &hpfs_file_ops; |
| 153 | result->i_nlink = 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | hpfs_i(result)->i_parent_dir = dir->i_ino; |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 155 | result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 156 | result->i_ctime.tv_nsec = 0; |
| 157 | result->i_mtime.tv_nsec = 0; |
| 158 | result->i_atime.tv_nsec = 0; |
| 159 | hpfs_i(result)->i_ea_size = 0; |
| 160 | if (dee.read_only) |
| 161 | result->i_mode &= ~0222; |
| 162 | result->i_blocks = 1; |
| 163 | result->i_size = 0; |
| 164 | result->i_data.a_ops = &hpfs_aops; |
| 165 | hpfs_i(result)->mmu_private = 0; |
| 166 | |
Mikulas Patocka | 7d23ce3 | 2011-05-08 20:43:06 +0200 | [diff] [blame] | 167 | r = hpfs_add_dirent(dir, name, len, &dee); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | if (r == 1) |
| 169 | goto bail2; |
| 170 | if (r == -1) { |
| 171 | err = -EEXIST; |
| 172 | goto bail2; |
| 173 | } |
| 174 | fnode->len = len; |
| 175 | memcpy(fnode->name, name, len > 15 ? 15 : len); |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 176 | fnode->up = cpu_to_le32(dir->i_ino); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | mark_buffer_dirty(bh); |
| 178 | brelse(bh); |
| 179 | |
| 180 | insert_inode_hash(result); |
| 181 | |
David Howells | de395b8 | 2008-11-14 10:38:55 +1100 | [diff] [blame] | 182 | if (result->i_uid != current_fsuid() || |
| 183 | result->i_gid != current_fsgid() || |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | result->i_mode != (mode | S_IFREG)) { |
David Howells | de395b8 | 2008-11-14 10:38:55 +1100 | [diff] [blame] | 185 | result->i_uid = current_fsuid(); |
| 186 | result->i_gid = current_fsgid(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | result->i_mode = mode | S_IFREG; |
| 188 | hpfs_write_inode_nolock(result); |
| 189 | } |
| 190 | d_instantiate(dentry, result); |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 191 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 192 | return 0; |
| 193 | |
| 194 | bail2: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 195 | iput(result); |
| 196 | bail1: |
| 197 | brelse(bh); |
| 198 | hpfs_free_sectors(dir->i_sb, fno, 1); |
| 199 | bail: |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 200 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | return err; |
| 202 | } |
| 203 | |
| 204 | static int hpfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) |
| 205 | { |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 206 | const unsigned char *name = dentry->d_name.name; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 207 | unsigned len = dentry->d_name.len; |
| 208 | struct buffer_head *bh; |
| 209 | struct fnode *fnode; |
| 210 | fnode_secno fno; |
| 211 | int r; |
| 212 | struct hpfs_dirent dee; |
| 213 | struct inode *result = NULL; |
| 214 | int err; |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 215 | if ((err = hpfs_chk_name(name, &len))) return err==-ENOENT ? -EINVAL : err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 216 | if (hpfs_sb(dir->i_sb)->sb_eas < 2) return -EPERM; |
| 217 | if (!new_valid_dev(rdev)) |
| 218 | return -EINVAL; |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 219 | hpfs_lock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | err = -ENOSPC; |
| 221 | fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); |
| 222 | if (!fnode) |
| 223 | goto bail; |
| 224 | memset(&dee, 0, sizeof dee); |
| 225 | if (!(mode & 0222)) dee.read_only = 1; |
| 226 | dee.archive = 1; |
| 227 | dee.hidden = name[0] == '.'; |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 228 | dee.fnode = cpu_to_le32(fno); |
| 229 | dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | |
| 231 | result = new_inode(dir->i_sb); |
| 232 | if (!result) |
| 233 | goto bail1; |
| 234 | |
| 235 | hpfs_init_inode(result); |
| 236 | result->i_ino = fno; |
| 237 | hpfs_i(result)->i_parent_dir = dir->i_ino; |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 238 | result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | result->i_ctime.tv_nsec = 0; |
| 240 | result->i_mtime.tv_nsec = 0; |
| 241 | result->i_atime.tv_nsec = 0; |
| 242 | hpfs_i(result)->i_ea_size = 0; |
David Howells | de395b8 | 2008-11-14 10:38:55 +1100 | [diff] [blame] | 243 | result->i_uid = current_fsuid(); |
| 244 | result->i_gid = current_fsgid(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | result->i_nlink = 1; |
| 246 | result->i_size = 0; |
| 247 | result->i_blocks = 1; |
| 248 | init_special_inode(result, mode, rdev); |
| 249 | |
Mikulas Patocka | 7d23ce3 | 2011-05-08 20:43:06 +0200 | [diff] [blame] | 250 | r = hpfs_add_dirent(dir, name, len, &dee); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | if (r == 1) |
| 252 | goto bail2; |
| 253 | if (r == -1) { |
| 254 | err = -EEXIST; |
| 255 | goto bail2; |
| 256 | } |
| 257 | fnode->len = len; |
| 258 | memcpy(fnode->name, name, len > 15 ? 15 : len); |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 259 | fnode->up = cpu_to_le32(dir->i_ino); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | mark_buffer_dirty(bh); |
| 261 | |
| 262 | insert_inode_hash(result); |
| 263 | |
| 264 | hpfs_write_inode_nolock(result); |
| 265 | d_instantiate(dentry, result); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | brelse(bh); |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 267 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | return 0; |
| 269 | bail2: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 270 | iput(result); |
| 271 | bail1: |
| 272 | brelse(bh); |
| 273 | hpfs_free_sectors(dir->i_sb, fno, 1); |
| 274 | bail: |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 275 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | return err; |
| 277 | } |
| 278 | |
| 279 | static int hpfs_symlink(struct inode *dir, struct dentry *dentry, const char *symlink) |
| 280 | { |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 281 | const unsigned char *name = dentry->d_name.name; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | unsigned len = dentry->d_name.len; |
| 283 | struct buffer_head *bh; |
| 284 | struct fnode *fnode; |
| 285 | fnode_secno fno; |
| 286 | int r; |
| 287 | struct hpfs_dirent dee; |
| 288 | struct inode *result; |
| 289 | int err; |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 290 | if ((err = hpfs_chk_name(name, &len))) return err==-ENOENT ? -EINVAL : err; |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 291 | hpfs_lock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 292 | if (hpfs_sb(dir->i_sb)->sb_eas < 2) { |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 293 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 294 | return -EPERM; |
| 295 | } |
| 296 | err = -ENOSPC; |
| 297 | fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); |
| 298 | if (!fnode) |
| 299 | goto bail; |
| 300 | memset(&dee, 0, sizeof dee); |
| 301 | dee.archive = 1; |
| 302 | dee.hidden = name[0] == '.'; |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 303 | dee.fnode = cpu_to_le32(fno); |
| 304 | dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | |
| 306 | result = new_inode(dir->i_sb); |
| 307 | if (!result) |
| 308 | goto bail1; |
| 309 | result->i_ino = fno; |
| 310 | hpfs_init_inode(result); |
| 311 | hpfs_i(result)->i_parent_dir = dir->i_ino; |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 312 | result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 | result->i_ctime.tv_nsec = 0; |
| 314 | result->i_mtime.tv_nsec = 0; |
| 315 | result->i_atime.tv_nsec = 0; |
| 316 | hpfs_i(result)->i_ea_size = 0; |
| 317 | result->i_mode = S_IFLNK | 0777; |
David Howells | de395b8 | 2008-11-14 10:38:55 +1100 | [diff] [blame] | 318 | result->i_uid = current_fsuid(); |
| 319 | result->i_gid = current_fsgid(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 320 | result->i_blocks = 1; |
| 321 | result->i_nlink = 1; |
| 322 | result->i_size = strlen(symlink); |
| 323 | result->i_op = &page_symlink_inode_operations; |
| 324 | result->i_data.a_ops = &hpfs_symlink_aops; |
| 325 | |
Mikulas Patocka | 7d23ce3 | 2011-05-08 20:43:06 +0200 | [diff] [blame] | 326 | r = hpfs_add_dirent(dir, name, len, &dee); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 327 | if (r == 1) |
| 328 | goto bail2; |
| 329 | if (r == -1) { |
| 330 | err = -EEXIST; |
| 331 | goto bail2; |
| 332 | } |
| 333 | fnode->len = len; |
| 334 | memcpy(fnode->name, name, len > 15 ? 15 : len); |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 335 | fnode->up = cpu_to_le32(dir->i_ino); |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 336 | hpfs_set_ea(result, fnode, "SYMLINK", symlink, strlen(symlink)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | mark_buffer_dirty(bh); |
| 338 | brelse(bh); |
| 339 | |
| 340 | insert_inode_hash(result); |
| 341 | |
| 342 | hpfs_write_inode_nolock(result); |
| 343 | d_instantiate(dentry, result); |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 344 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 345 | return 0; |
| 346 | bail2: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 347 | iput(result); |
| 348 | bail1: |
| 349 | brelse(bh); |
| 350 | hpfs_free_sectors(dir->i_sb, fno, 1); |
| 351 | bail: |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 352 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 353 | return err; |
| 354 | } |
| 355 | |
| 356 | static int hpfs_unlink(struct inode *dir, struct dentry *dentry) |
| 357 | { |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 358 | const unsigned char *name = dentry->d_name.name; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | unsigned len = dentry->d_name.len; |
| 360 | struct quad_buffer_head qbh; |
| 361 | struct hpfs_dirent *de; |
| 362 | struct inode *inode = dentry->d_inode; |
| 363 | dnode_secno dno; |
| 364 | fnode_secno fno; |
| 365 | int r; |
| 366 | int rep = 0; |
| 367 | int err; |
| 368 | |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 369 | hpfs_lock(dir->i_sb); |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 370 | hpfs_adjust_length(name, &len); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 371 | again: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 372 | err = -ENOENT; |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 373 | de = map_dirent(dir, hpfs_i(dir)->i_dno, name, len, &dno, &qbh); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 374 | if (!de) |
| 375 | goto out; |
| 376 | |
| 377 | err = -EPERM; |
| 378 | if (de->first) |
| 379 | goto out1; |
| 380 | |
| 381 | err = -EISDIR; |
| 382 | if (de->directory) |
| 383 | goto out1; |
| 384 | |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 385 | fno = le32_to_cpu(de->fnode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | r = hpfs_remove_dirent(dir, dno, de, &qbh, 1); |
| 387 | switch (r) { |
| 388 | case 1: |
| 389 | hpfs_error(dir->i_sb, "there was error when removing dirent"); |
| 390 | err = -EFSERROR; |
| 391 | break; |
| 392 | case 2: /* no space for deleting, try to truncate file */ |
| 393 | |
| 394 | err = -ENOSPC; |
| 395 | if (rep++) |
| 396 | break; |
| 397 | |
Al Viro | e21e709 | 2010-02-01 11:05:16 -0500 | [diff] [blame] | 398 | dentry_unhash(dentry); |
| 399 | if (!d_unhashed(dentry)) { |
| 400 | dput(dentry); |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 401 | hpfs_unlock(dir->i_sb); |
Al Viro | e21e709 | 2010-02-01 11:05:16 -0500 | [diff] [blame] | 402 | return -ENOSPC; |
| 403 | } |
Nick Piggin | b74c79e | 2011-01-07 17:49:58 +1100 | [diff] [blame] | 404 | if (generic_permission(inode, MAY_WRITE, 0, NULL) || |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 405 | !S_ISREG(inode->i_mode) || |
| 406 | get_write_access(inode)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 407 | d_rehash(dentry); |
Al Viro | e21e709 | 2010-02-01 11:05:16 -0500 | [diff] [blame] | 408 | dput(dentry); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 409 | } else { |
| 410 | struct iattr newattrs; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 411 | /*printk("HPFS: truncating file before delete.\n");*/ |
| 412 | newattrs.ia_size = 0; |
| 413 | newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; |
| 414 | err = notify_change(dentry, &newattrs); |
| 415 | put_write_access(inode); |
Al Viro | e21e709 | 2010-02-01 11:05:16 -0500 | [diff] [blame] | 416 | dput(dentry); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 417 | if (!err) |
| 418 | goto again; |
| 419 | } |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 420 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 421 | return -ENOSPC; |
| 422 | default: |
Dave Hansen | 9a53c3a | 2006-09-30 23:29:03 -0700 | [diff] [blame] | 423 | drop_nlink(inode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 424 | err = 0; |
| 425 | } |
| 426 | goto out; |
| 427 | |
| 428 | out1: |
| 429 | hpfs_brelse4(&qbh); |
| 430 | out: |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 431 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 432 | return err; |
| 433 | } |
| 434 | |
| 435 | static int hpfs_rmdir(struct inode *dir, struct dentry *dentry) |
| 436 | { |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 437 | const unsigned char *name = dentry->d_name.name; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 438 | unsigned len = dentry->d_name.len; |
| 439 | struct quad_buffer_head qbh; |
| 440 | struct hpfs_dirent *de; |
| 441 | struct inode *inode = dentry->d_inode; |
| 442 | dnode_secno dno; |
| 443 | fnode_secno fno; |
| 444 | int n_items = 0; |
| 445 | int err; |
| 446 | int r; |
| 447 | |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 448 | hpfs_adjust_length(name, &len); |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 449 | hpfs_lock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 450 | err = -ENOENT; |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 451 | de = map_dirent(dir, hpfs_i(dir)->i_dno, name, len, &dno, &qbh); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 452 | if (!de) |
| 453 | goto out; |
| 454 | |
| 455 | err = -EPERM; |
| 456 | if (de->first) |
| 457 | goto out1; |
| 458 | |
| 459 | err = -ENOTDIR; |
| 460 | if (!de->directory) |
| 461 | goto out1; |
| 462 | |
| 463 | hpfs_count_dnodes(dir->i_sb, hpfs_i(inode)->i_dno, NULL, NULL, &n_items); |
| 464 | err = -ENOTEMPTY; |
| 465 | if (n_items) |
| 466 | goto out1; |
| 467 | |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 468 | fno = le32_to_cpu(de->fnode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 469 | r = hpfs_remove_dirent(dir, dno, de, &qbh, 1); |
| 470 | switch (r) { |
| 471 | case 1: |
| 472 | hpfs_error(dir->i_sb, "there was error when removing dirent"); |
| 473 | err = -EFSERROR; |
| 474 | break; |
| 475 | case 2: |
| 476 | err = -ENOSPC; |
| 477 | break; |
| 478 | default: |
Dave Hansen | 9a53c3a | 2006-09-30 23:29:03 -0700 | [diff] [blame] | 479 | drop_nlink(dir); |
Dave Hansen | ce71ec3 | 2006-09-30 23:29:06 -0700 | [diff] [blame] | 480 | clear_nlink(inode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 481 | err = 0; |
| 482 | } |
| 483 | goto out; |
| 484 | out1: |
| 485 | hpfs_brelse4(&qbh); |
| 486 | out: |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 487 | hpfs_unlock(dir->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 488 | return err; |
| 489 | } |
| 490 | |
| 491 | static int hpfs_symlink_readpage(struct file *file, struct page *page) |
| 492 | { |
| 493 | char *link = kmap(page); |
| 494 | struct inode *i = page->mapping->host; |
| 495 | struct fnode *fnode; |
| 496 | struct buffer_head *bh; |
| 497 | int err; |
| 498 | |
| 499 | err = -EIO; |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 500 | hpfs_lock(i->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 501 | if (!(fnode = hpfs_map_fnode(i->i_sb, i->i_ino, &bh))) |
| 502 | goto fail; |
| 503 | err = hpfs_read_ea(i->i_sb, fnode, "SYMLINK", link, PAGE_SIZE); |
| 504 | brelse(bh); |
| 505 | if (err) |
| 506 | goto fail; |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 507 | hpfs_unlock(i->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 508 | SetPageUptodate(page); |
| 509 | kunmap(page); |
| 510 | unlock_page(page); |
| 511 | return 0; |
| 512 | |
| 513 | fail: |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 514 | hpfs_unlock(i->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 515 | SetPageError(page); |
| 516 | kunmap(page); |
| 517 | unlock_page(page); |
| 518 | return err; |
| 519 | } |
| 520 | |
Christoph Hellwig | f5e54d6 | 2006-06-28 04:26:44 -0700 | [diff] [blame] | 521 | const struct address_space_operations hpfs_symlink_aops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 522 | .readpage = hpfs_symlink_readpage |
| 523 | }; |
| 524 | |
| 525 | static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry, |
| 526 | struct inode *new_dir, struct dentry *new_dentry) |
| 527 | { |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 528 | const unsigned char *old_name = old_dentry->d_name.name; |
| 529 | unsigned old_len = old_dentry->d_name.len; |
| 530 | const unsigned char *new_name = new_dentry->d_name.name; |
| 531 | unsigned new_len = new_dentry->d_name.len; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 532 | struct inode *i = old_dentry->d_inode; |
| 533 | struct inode *new_inode = new_dentry->d_inode; |
| 534 | struct quad_buffer_head qbh, qbh1; |
| 535 | struct hpfs_dirent *dep, *nde; |
| 536 | struct hpfs_dirent de; |
| 537 | dnode_secno dno; |
| 538 | int r; |
| 539 | struct buffer_head *bh; |
| 540 | struct fnode *fnode; |
| 541 | int err; |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 542 | if ((err = hpfs_chk_name(new_name, &new_len))) return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 543 | err = 0; |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 544 | hpfs_adjust_length(old_name, &old_len); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 545 | |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 546 | hpfs_lock(i->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 547 | /* order doesn't matter, due to VFS exclusion */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 548 | |
| 549 | /* Erm? Moving over the empty non-busy directory is perfectly legal */ |
| 550 | if (new_inode && S_ISDIR(new_inode->i_mode)) { |
| 551 | err = -EINVAL; |
| 552 | goto end1; |
| 553 | } |
| 554 | |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 555 | if (!(dep = map_dirent(old_dir, hpfs_i(old_dir)->i_dno, old_name, old_len, &dno, &qbh))) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 556 | hpfs_error(i->i_sb, "lookup succeeded but map dirent failed"); |
| 557 | err = -ENOENT; |
| 558 | goto end1; |
| 559 | } |
| 560 | copy_de(&de, dep); |
| 561 | de.hidden = new_name[0] == '.'; |
| 562 | |
| 563 | if (new_inode) { |
| 564 | int r; |
| 565 | if ((r = hpfs_remove_dirent(old_dir, dno, dep, &qbh, 1)) != 2) { |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 566 | if ((nde = map_dirent(new_dir, hpfs_i(new_dir)->i_dno, new_name, new_len, NULL, &qbh1))) { |
Dave Hansen | ce71ec3 | 2006-09-30 23:29:06 -0700 | [diff] [blame] | 567 | clear_nlink(new_inode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 568 | copy_de(nde, &de); |
| 569 | memcpy(nde->name, new_name, new_len); |
| 570 | hpfs_mark_4buffers_dirty(&qbh1); |
| 571 | hpfs_brelse4(&qbh1); |
| 572 | goto end; |
| 573 | } |
| 574 | hpfs_error(new_dir->i_sb, "hpfs_rename: could not find dirent"); |
| 575 | err = -EFSERROR; |
| 576 | goto end1; |
| 577 | } |
| 578 | err = r == 2 ? -ENOSPC : r == 1 ? -EFSERROR : 0; |
| 579 | goto end1; |
| 580 | } |
| 581 | |
| 582 | if (new_dir == old_dir) hpfs_brelse4(&qbh); |
| 583 | |
Mikulas Patocka | 7d23ce3 | 2011-05-08 20:43:06 +0200 | [diff] [blame] | 584 | if ((r = hpfs_add_dirent(new_dir, new_name, new_len, &de))) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 585 | if (r == -1) hpfs_error(new_dir->i_sb, "hpfs_rename: dirent already exists!"); |
| 586 | err = r == 1 ? -ENOSPC : -EFSERROR; |
| 587 | if (new_dir != old_dir) hpfs_brelse4(&qbh); |
| 588 | goto end1; |
| 589 | } |
| 590 | |
| 591 | if (new_dir == old_dir) |
Al Viro | 7e7742e | 2010-01-31 17:09:29 -0500 | [diff] [blame] | 592 | if (!(dep = map_dirent(old_dir, hpfs_i(old_dir)->i_dno, old_name, old_len, &dno, &qbh))) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 593 | hpfs_error(i->i_sb, "lookup succeeded but map dirent failed at #2"); |
| 594 | err = -ENOENT; |
| 595 | goto end1; |
| 596 | } |
| 597 | |
| 598 | if ((r = hpfs_remove_dirent(old_dir, dno, dep, &qbh, 0))) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 599 | hpfs_error(i->i_sb, "hpfs_rename: could not remove dirent"); |
| 600 | err = r == 2 ? -ENOSPC : -EFSERROR; |
| 601 | goto end1; |
| 602 | } |
Mikulas Patocka | 7d23ce3 | 2011-05-08 20:43:06 +0200 | [diff] [blame] | 603 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 604 | end: |
| 605 | hpfs_i(i)->i_parent_dir = new_dir->i_ino; |
| 606 | if (S_ISDIR(i->i_mode)) { |
Dave Hansen | d8c76e6 | 2006-09-30 23:29:04 -0700 | [diff] [blame] | 607 | inc_nlink(new_dir); |
Dave Hansen | 9a53c3a | 2006-09-30 23:29:03 -0700 | [diff] [blame] | 608 | drop_nlink(old_dir); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 609 | } |
| 610 | if ((fnode = hpfs_map_fnode(i->i_sb, i->i_ino, &bh))) { |
Mikulas Patocka | 0b69760 | 2011-05-08 20:44:26 +0200 | [diff] [blame^] | 611 | fnode->up = cpu_to_le32(new_dir->i_ino); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 612 | fnode->len = new_len; |
| 613 | memcpy(fnode->name, new_name, new_len>15?15:new_len); |
| 614 | if (new_len < 15) memset(&fnode->name[new_len], 0, 15 - new_len); |
| 615 | mark_buffer_dirty(bh); |
| 616 | brelse(bh); |
| 617 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 618 | end1: |
Arnd Bergmann | 9a311b9 | 2011-01-22 20:26:12 +0100 | [diff] [blame] | 619 | hpfs_unlock(i->i_sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 620 | return err; |
| 621 | } |
| 622 | |
Arjan van de Ven | 92e1d5b | 2007-02-12 00:55:39 -0800 | [diff] [blame] | 623 | const struct inode_operations hpfs_dir_iops = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 624 | { |
| 625 | .create = hpfs_create, |
| 626 | .lookup = hpfs_lookup, |
| 627 | .unlink = hpfs_unlink, |
| 628 | .symlink = hpfs_symlink, |
| 629 | .mkdir = hpfs_mkdir, |
| 630 | .rmdir = hpfs_rmdir, |
| 631 | .mknod = hpfs_mknod, |
| 632 | .rename = hpfs_rename, |
Christoph Hellwig | ca30bc9 | 2008-08-11 00:27:59 +0200 | [diff] [blame] | 633 | .setattr = hpfs_setattr, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 634 | }; |