diff options
| author | Jaroslav Kysela <perex@perex.cz> | 2010-01-08 03:11:18 -0500 |
|---|---|---|
| committer | Jaroslav Kysela <perex@perex.cz> | 2010-01-08 03:11:18 -0500 |
| commit | a4ad68d57e4dc4138304df23d1817eb094149389 (patch) | |
| tree | ca7d8c4ce5377c4251560de06e15dd7be7063351 /fs/ext2 | |
| parent | cd9d95a55550555da8e587ead9cbba5f98a371a3 (diff) | |
| parent | c97259df3f2e163c72f4d0685c61fb2e026dc989 (diff) | |
Merge branch 'topic/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into devel
Diffstat (limited to 'fs/ext2')
| -rw-r--r-- | fs/ext2/acl.c | 79 | ||||
| -rw-r--r-- | fs/ext2/dir.c | 2 | ||||
| -rw-r--r-- | fs/ext2/ext2.h | 1 | ||||
| -rw-r--r-- | fs/ext2/file.c | 21 | ||||
| -rw-r--r-- | fs/ext2/super.c | 22 | ||||
| -rw-r--r-- | fs/ext2/xattr.c | 11 | ||||
| -rw-r--r-- | fs/ext2/xattr_security.c | 16 | ||||
| -rw-r--r-- | fs/ext2/xattr_trusted.c | 16 | ||||
| -rw-r--r-- | fs/ext2/xattr_user.c | 25 |
9 files changed, 104 insertions, 89 deletions
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index a63d44256a70..a99e54318c3d 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c | |||
| @@ -339,12 +339,12 @@ ext2_acl_chmod(struct inode *inode) | |||
| 339 | * Extended attribut handlers | 339 | * Extended attribut handlers |
| 340 | */ | 340 | */ |
| 341 | static size_t | 341 | static size_t |
| 342 | ext2_xattr_list_acl_access(struct inode *inode, char *list, size_t list_size, | 342 | ext2_xattr_list_acl_access(struct dentry *dentry, char *list, size_t list_size, |
| 343 | const char *name, size_t name_len) | 343 | const char *name, size_t name_len, int type) |
| 344 | { | 344 | { |
| 345 | const size_t size = sizeof(POSIX_ACL_XATTR_ACCESS); | 345 | const size_t size = sizeof(POSIX_ACL_XATTR_ACCESS); |
| 346 | 346 | ||
| 347 | if (!test_opt(inode->i_sb, POSIX_ACL)) | 347 | if (!test_opt(dentry->d_sb, POSIX_ACL)) |
| 348 | return 0; | 348 | return 0; |
| 349 | if (list && size <= list_size) | 349 | if (list && size <= list_size) |
| 350 | memcpy(list, POSIX_ACL_XATTR_ACCESS, size); | 350 | memcpy(list, POSIX_ACL_XATTR_ACCESS, size); |
| @@ -352,12 +352,12 @@ ext2_xattr_list_acl_access(struct inode *inode, char *list, size_t list_size, | |||
| 352 | } | 352 | } |
| 353 | 353 | ||
| 354 | static size_t | 354 | static size_t |
| 355 | ext2_xattr_list_acl_default(struct inode *inode, char *list, size_t list_size, | 355 | ext2_xattr_list_acl_default(struct dentry *dentry, char *list, size_t list_size, |
| 356 | const char *name, size_t name_len) | 356 | const char *name, size_t name_len, int type) |
| 357 | { | 357 | { |
| 358 | const size_t size = sizeof(POSIX_ACL_XATTR_DEFAULT); | 358 | const size_t size = sizeof(POSIX_ACL_XATTR_DEFAULT); |
| 359 | 359 | ||
| 360 | if (!test_opt(inode->i_sb, POSIX_ACL)) | 360 | if (!test_opt(dentry->d_sb, POSIX_ACL)) |
| 361 | return 0; | 361 | return 0; |
| 362 | if (list && size <= list_size) | 362 | if (list && size <= list_size) |
| 363 | memcpy(list, POSIX_ACL_XATTR_DEFAULT, size); | 363 | memcpy(list, POSIX_ACL_XATTR_DEFAULT, size); |
| @@ -365,15 +365,18 @@ ext2_xattr_list_acl_default(struct inode *inode, char *list, size_t list_size, | |||
| 365 | } | 365 | } |
| 366 | 366 | ||
| 367 | static int | 367 | static int |
| 368 | ext2_xattr_get_acl(struct inode *inode, int type, void *buffer, size_t size) | 368 | ext2_xattr_get_acl(struct dentry *dentry, const char *name, void *buffer, |
| 369 | size_t size, int type) | ||
| 369 | { | 370 | { |
| 370 | struct posix_acl *acl; | 371 | struct posix_acl *acl; |
| 371 | int error; | 372 | int error; |
| 372 | 373 | ||
| 373 | if (!test_opt(inode->i_sb, POSIX_ACL)) | 374 | if (strcmp(name, "") != 0) |
| 375 | return -EINVAL; | ||
| 376 | if (!test_opt(dentry->d_sb, POSIX_ACL)) | ||
| 374 | return -EOPNOTSUPP; | 377 | return -EOPNOTSUPP; |
| 375 | 378 | ||
| 376 | acl = ext2_get_acl(inode, type); | 379 | acl = ext2_get_acl(dentry->d_inode, type); |
| 377 | if (IS_ERR(acl)) | 380 | if (IS_ERR(acl)) |
| 378 | return PTR_ERR(acl); | 381 | return PTR_ERR(acl); |
| 379 | if (acl == NULL) | 382 | if (acl == NULL) |
| @@ -385,33 +388,17 @@ ext2_xattr_get_acl(struct inode *inode, int type, void *buffer, size_t size) | |||
| 385 | } | 388 | } |
| 386 | 389 | ||
| 387 | static int | 390 | static int |
| 388 | ext2_xattr_get_acl_access(struct inode *inode, const char *name, | 391 | ext2_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, |
| 389 | void *buffer, size_t size) | 392 | size_t size, int flags, int type) |
| 390 | { | ||
| 391 | if (strcmp(name, "") != 0) | ||
| 392 | return -EINVAL; | ||
| 393 | return ext2_xattr_get_acl(inode, ACL_TYPE_ACCESS, buffer, size); | ||
| 394 | } | ||
| 395 | |||
| 396 | static int | ||
| 397 | ext2_xattr_get_acl_default(struct inode *inode, const char *name, | ||
| 398 | void *buffer, size_t size) | ||
| 399 | { | ||
| 400 | if (strcmp(name, "") != 0) | ||
| 401 | return -EINVAL; | ||
| 402 | return ext2_xattr_get_acl(inode, ACL_TYPE_DEFAULT, buffer, size); | ||
| 403 | } | ||
| 404 | |||
| 405 | static int | ||
| 406 | ext2_xattr_set_acl(struct inode *inode, int type, const void *value, | ||
| 407 | size_t size) | ||
| 408 | { | 393 | { |
| 409 | struct posix_acl *acl; | 394 | struct posix_acl *acl; |
| 410 | int error; | 395 | int error; |
| 411 | 396 | ||
| 412 | if (!test_opt(inode->i_sb, POSIX_ACL)) | 397 | if (strcmp(name, "") != 0) |
| 398 | return -EINVAL; | ||
| 399 | if (!test_opt(dentry->d_sb, POSIX_ACL)) | ||
| 413 | return -EOPNOTSUPP; | 400 | return -EOPNOTSUPP; |
| 414 | if (!is_owner_or_cap(inode)) | 401 | if (!is_owner_or_cap(dentry->d_inode)) |
| 415 | return -EPERM; | 402 | return -EPERM; |
| 416 | 403 | ||
| 417 | if (value) { | 404 | if (value) { |
| @@ -426,41 +413,25 @@ ext2_xattr_set_acl(struct inode *inode, int type, const void *value, | |||
| 426 | } else | 413 | } else |
| 427 | acl = NULL; | 414 | acl = NULL; |
| 428 | 415 | ||
| 429 | error = ext2_set_acl(inode, type, acl); | 416 | error = ext2_set_acl(dentry->d_inode, type, acl); |
| 430 | 417 | ||
| 431 | release_and_out: | 418 | release_and_out: |
| 432 | posix_acl_release(acl); | 419 | posix_acl_release(acl); |
| 433 | return error; | 420 | return error; |
| 434 | } | 421 | } |
| 435 | 422 | ||
| 436 | static int | ||
| 437 | ext2_xattr_set_acl_access(struct inode *inode, const char *name, | ||
| 438 | const void *value, size_t size, int flags) | ||
| 439 | { | ||
| 440 | if (strcmp(name, "") != 0) | ||
| 441 | return -EINVAL; | ||
| 442 | return ext2_xattr_set_acl(inode, ACL_TYPE_ACCESS, value, size); | ||
| 443 | } | ||
| 444 | |||
| 445 | static int | ||
| 446 | ext2_xattr_set_acl_default(struct inode *inode, const char *name, | ||
| 447 | const void *value, size_t size, int flags) | ||
| 448 | { | ||
| 449 | if (strcmp(name, "") != 0) | ||
| 450 | return -EINVAL; | ||
| 451 | return ext2_xattr_set_acl(inode, ACL_TYPE_DEFAULT, value, size); | ||
| 452 | } | ||
| 453 | |||
| 454 | struct xattr_handler ext2_xattr_acl_access_handler = { | 423 | struct xattr_handler ext2_xattr_acl_access_handler = { |
| 455 | .prefix = POSIX_ACL_XATTR_ACCESS, | 424 | .prefix = POSIX_ACL_XATTR_ACCESS, |
| 425 | .flags = ACL_TYPE_ACCESS, | ||
| 456 | .list = ext2_xattr_list_acl_access, | 426 | .list = ext2_xattr_list_acl_access, |
| 457 | .get = ext2_xattr_get_acl_access, | 427 | .get = ext2_xattr_get_acl, |
| 458 | .set = ext2_xattr_set_acl_access, | 428 | .set = ext2_xattr_set_acl, |
| 459 | }; | 429 | }; |
| 460 | 430 | ||
| 461 | struct xattr_handler ext2_xattr_acl_default_handler = { | 431 | struct xattr_handler ext2_xattr_acl_default_handler = { |
| 462 | .prefix = POSIX_ACL_XATTR_DEFAULT, | 432 | .prefix = POSIX_ACL_XATTR_DEFAULT, |
| 433 | .flags = ACL_TYPE_DEFAULT, | ||
| 463 | .list = ext2_xattr_list_acl_default, | 434 | .list = ext2_xattr_list_acl_default, |
| 464 | .get = ext2_xattr_get_acl_default, | 435 | .get = ext2_xattr_get_acl, |
| 465 | .set = ext2_xattr_set_acl_default, | 436 | .set = ext2_xattr_set_acl, |
| 466 | }; | 437 | }; |
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index fc2bd05d3559..7516957273ed 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c | |||
| @@ -721,5 +721,5 @@ const struct file_operations ext2_dir_operations = { | |||
| 721 | #ifdef CONFIG_COMPAT | 721 | #ifdef CONFIG_COMPAT |
| 722 | .compat_ioctl = ext2_compat_ioctl, | 722 | .compat_ioctl = ext2_compat_ioctl, |
| 723 | #endif | 723 | #endif |
| 724 | .fsync = simple_fsync, | 724 | .fsync = ext2_fsync, |
| 725 | }; | 725 | }; |
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index da318b0fa637..061914add3cf 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h | |||
| @@ -155,6 +155,7 @@ extern void ext2_write_super (struct super_block *); | |||
| 155 | extern const struct file_operations ext2_dir_operations; | 155 | extern const struct file_operations ext2_dir_operations; |
| 156 | 156 | ||
| 157 | /* file.c */ | 157 | /* file.c */ |
| 158 | extern int ext2_fsync(struct file *file, struct dentry *dentry, int datasync); | ||
| 158 | extern const struct inode_operations ext2_file_inode_operations; | 159 | extern const struct inode_operations ext2_file_inode_operations; |
| 159 | extern const struct file_operations ext2_file_operations; | 160 | extern const struct file_operations ext2_file_operations; |
| 160 | extern const struct file_operations ext2_xip_file_operations; | 161 | extern const struct file_operations ext2_xip_file_operations; |
diff --git a/fs/ext2/file.c b/fs/ext2/file.c index a2f3afd1a1c1..586e3589d4c2 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #include <linux/time.h> | 21 | #include <linux/time.h> |
| 22 | #include <linux/pagemap.h> | ||
| 22 | #include "ext2.h" | 23 | #include "ext2.h" |
| 23 | #include "xattr.h" | 24 | #include "xattr.h" |
| 24 | #include "acl.h" | 25 | #include "acl.h" |
| @@ -38,6 +39,22 @@ static int ext2_release_file (struct inode * inode, struct file * filp) | |||
| 38 | return 0; | 39 | return 0; |
| 39 | } | 40 | } |
| 40 | 41 | ||
| 42 | int ext2_fsync(struct file *file, struct dentry *dentry, int datasync) | ||
| 43 | { | ||
| 44 | int ret; | ||
| 45 | struct super_block *sb = dentry->d_inode->i_sb; | ||
| 46 | struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; | ||
| 47 | |||
| 48 | ret = simple_fsync(file, dentry, datasync); | ||
| 49 | if (ret == -EIO || test_and_clear_bit(AS_EIO, &mapping->flags)) { | ||
| 50 | /* We don't really know where the IO error happened... */ | ||
| 51 | ext2_error(sb, __func__, | ||
| 52 | "detected IO error when writing metadata buffers"); | ||
| 53 | ret = -EIO; | ||
| 54 | } | ||
| 55 | return ret; | ||
| 56 | } | ||
| 57 | |||
| 41 | /* | 58 | /* |
| 42 | * We have mostly NULL's here: the current defaults are ok for | 59 | * We have mostly NULL's here: the current defaults are ok for |
| 43 | * the ext2 filesystem. | 60 | * the ext2 filesystem. |
| @@ -55,7 +72,7 @@ const struct file_operations ext2_file_operations = { | |||
| 55 | .mmap = generic_file_mmap, | 72 | .mmap = generic_file_mmap, |
| 56 | .open = generic_file_open, | 73 | .open = generic_file_open, |
| 57 | .release = ext2_release_file, | 74 | .release = ext2_release_file, |
| 58 | .fsync = simple_fsync, | 75 | .fsync = ext2_fsync, |
| 59 | .splice_read = generic_file_splice_read, | 76 | .splice_read = generic_file_splice_read, |
| 60 | .splice_write = generic_file_splice_write, | 77 | .splice_write = generic_file_splice_write, |
| 61 | }; | 78 | }; |
| @@ -72,7 +89,7 @@ const struct file_operations ext2_xip_file_operations = { | |||
| 72 | .mmap = xip_file_mmap, | 89 | .mmap = xip_file_mmap, |
| 73 | .open = generic_file_open, | 90 | .open = generic_file_open, |
| 74 | .release = ext2_release_file, | 91 | .release = ext2_release_file, |
| 75 | .fsync = simple_fsync, | 92 | .fsync = ext2_fsync, |
| 76 | }; | 93 | }; |
| 77 | #endif | 94 | #endif |
| 78 | 95 | ||
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 1388802b7803..f9cb54a585ce 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
| @@ -1105,9 +1105,30 @@ failed_sbi: | |||
| 1105 | return ret; | 1105 | return ret; |
| 1106 | } | 1106 | } |
| 1107 | 1107 | ||
| 1108 | static void ext2_clear_super_error(struct super_block *sb) | ||
| 1109 | { | ||
| 1110 | struct buffer_head *sbh = EXT2_SB(sb)->s_sbh; | ||
| 1111 | |||
| 1112 | if (buffer_write_io_error(sbh)) { | ||
| 1113 | /* | ||
| 1114 | * Oh, dear. A previous attempt to write the | ||
| 1115 | * superblock failed. This could happen because the | ||
| 1116 | * USB device was yanked out. Or it could happen to | ||
| 1117 | * be a transient write error and maybe the block will | ||
| 1118 | * be remapped. Nothing we can do but to retry the | ||
| 1119 | * write and hope for the best. | ||
| 1120 | */ | ||
| 1121 | printk(KERN_ERR "EXT2-fs: %s previous I/O error to " | ||
| 1122 | "superblock detected", sb->s_id); | ||
| 1123 | clear_buffer_write_io_error(sbh); | ||
| 1124 | set_buffer_uptodate(sbh); | ||
| 1125 | } | ||
| 1126 | } | ||
| 1127 | |||
| 1108 | static void ext2_commit_super (struct super_block * sb, | 1128 | static void ext2_commit_super (struct super_block * sb, |
| 1109 | struct ext2_super_block * es) | 1129 | struct ext2_super_block * es) |
| 1110 | { | 1130 | { |
| 1131 | ext2_clear_super_error(sb); | ||
| 1111 | es->s_wtime = cpu_to_le32(get_seconds()); | 1132 | es->s_wtime = cpu_to_le32(get_seconds()); |
| 1112 | mark_buffer_dirty(EXT2_SB(sb)->s_sbh); | 1133 | mark_buffer_dirty(EXT2_SB(sb)->s_sbh); |
| 1113 | sb->s_dirt = 0; | 1134 | sb->s_dirt = 0; |
| @@ -1115,6 +1136,7 @@ static void ext2_commit_super (struct super_block * sb, | |||
| 1115 | 1136 | ||
| 1116 | static void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es) | 1137 | static void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es) |
| 1117 | { | 1138 | { |
| 1139 | ext2_clear_super_error(sb); | ||
| 1118 | es->s_free_blocks_count = cpu_to_le32(ext2_count_free_blocks(sb)); | 1140 | es->s_free_blocks_count = cpu_to_le32(ext2_count_free_blocks(sb)); |
| 1119 | es->s_free_inodes_count = cpu_to_le32(ext2_count_free_inodes(sb)); | 1141 | es->s_free_inodes_count = cpu_to_le32(ext2_count_free_inodes(sb)); |
| 1120 | es->s_wtime = cpu_to_le32(get_seconds()); | 1142 | es->s_wtime = cpu_to_le32(get_seconds()); |
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index 7913531ec6d5..904f00642f84 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | #include <linux/mbcache.h> | 60 | #include <linux/mbcache.h> |
| 61 | #include <linux/quotaops.h> | 61 | #include <linux/quotaops.h> |
| 62 | #include <linux/rwsem.h> | 62 | #include <linux/rwsem.h> |
| 63 | #include <linux/security.h> | ||
| 63 | #include "ext2.h" | 64 | #include "ext2.h" |
| 64 | #include "xattr.h" | 65 | #include "xattr.h" |
| 65 | #include "acl.h" | 66 | #include "acl.h" |
| @@ -249,8 +250,9 @@ cleanup: | |||
| 249 | * used / required on success. | 250 | * used / required on success. |
| 250 | */ | 251 | */ |
| 251 | static int | 252 | static int |
| 252 | ext2_xattr_list(struct inode *inode, char *buffer, size_t buffer_size) | 253 | ext2_xattr_list(struct dentry *dentry, char *buffer, size_t buffer_size) |
| 253 | { | 254 | { |
| 255 | struct inode *inode = dentry->d_inode; | ||
| 254 | struct buffer_head *bh = NULL; | 256 | struct buffer_head *bh = NULL; |
| 255 | struct ext2_xattr_entry *entry; | 257 | struct ext2_xattr_entry *entry; |
| 256 | char *end; | 258 | char *end; |
| @@ -300,9 +302,10 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_list", | |||
| 300 | ext2_xattr_handler(entry->e_name_index); | 302 | ext2_xattr_handler(entry->e_name_index); |
| 301 | 303 | ||
| 302 | if (handler) { | 304 | if (handler) { |
| 303 | size_t size = handler->list(inode, buffer, rest, | 305 | size_t size = handler->list(dentry, buffer, rest, |
| 304 | entry->e_name, | 306 | entry->e_name, |
| 305 | entry->e_name_len); | 307 | entry->e_name_len, |
| 308 | handler->flags); | ||
| 306 | if (buffer) { | 309 | if (buffer) { |
| 307 | if (size > rest) { | 310 | if (size > rest) { |
| 308 | error = -ERANGE; | 311 | error = -ERANGE; |
| @@ -330,7 +333,7 @@ cleanup: | |||
| 330 | ssize_t | 333 | ssize_t |
| 331 | ext2_listxattr(struct dentry *dentry, char *buffer, size_t size) | 334 | ext2_listxattr(struct dentry *dentry, char *buffer, size_t size) |
| 332 | { | 335 | { |
| 333 | return ext2_xattr_list(dentry->d_inode, buffer, size); | 336 | return ext2_xattr_list(dentry, buffer, size); |
| 334 | } | 337 | } |
| 335 | 338 | ||
| 336 | /* | 339 | /* |
diff --git a/fs/ext2/xattr_security.c b/fs/ext2/xattr_security.c index 70c0dbdcdcb7..c8155845ac05 100644 --- a/fs/ext2/xattr_security.c +++ b/fs/ext2/xattr_security.c | |||
| @@ -11,8 +11,8 @@ | |||
| 11 | #include "xattr.h" | 11 | #include "xattr.h" |
| 12 | 12 | ||
| 13 | static size_t | 13 | static size_t |
| 14 | ext2_xattr_security_list(struct inode *inode, char *list, size_t list_size, | 14 | ext2_xattr_security_list(struct dentry *dentry, char *list, size_t list_size, |
| 15 | const char *name, size_t name_len) | 15 | const char *name, size_t name_len, int type) |
| 16 | { | 16 | { |
| 17 | const int prefix_len = XATTR_SECURITY_PREFIX_LEN; | 17 | const int prefix_len = XATTR_SECURITY_PREFIX_LEN; |
| 18 | const size_t total_len = prefix_len + name_len + 1; | 18 | const size_t total_len = prefix_len + name_len + 1; |
| @@ -26,22 +26,22 @@ ext2_xattr_security_list(struct inode *inode, char *list, size_t list_size, | |||
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | static int | 28 | static int |
| 29 | ext2_xattr_security_get(struct inode *inode, const char *name, | 29 | ext2_xattr_security_get(struct dentry *dentry, const char *name, |
| 30 | void *buffer, size_t size) | 30 | void *buffer, size_t size, int type) |
| 31 | { | 31 | { |
| 32 | if (strcmp(name, "") == 0) | 32 | if (strcmp(name, "") == 0) |
| 33 | return -EINVAL; | 33 | return -EINVAL; |
| 34 | return ext2_xattr_get(inode, EXT2_XATTR_INDEX_SECURITY, name, | 34 | return ext2_xattr_get(dentry->d_inode, EXT2_XATTR_INDEX_SECURITY, name, |
| 35 | buffer, size); | 35 | buffer, size); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | static int | 38 | static int |
| 39 | ext2_xattr_security_set(struct inode *inode, const char *name, | 39 | ext2_xattr_security_set(struct dentry *dentry, const char *name, |
| 40 | const void *value, size_t size, int flags) | 40 | const void *value, size_t size, int flags, int type) |
| 41 | { | 41 | { |
| 42 | if (strcmp(name, "") == 0) | 42 | if (strcmp(name, "") == 0) |
| 43 | return -EINVAL; | 43 | return -EINVAL; |
| 44 | return ext2_xattr_set(inode, EXT2_XATTR_INDEX_SECURITY, name, | 44 | return ext2_xattr_set(dentry->d_inode, EXT2_XATTR_INDEX_SECURITY, name, |
| 45 | value, size, flags); | 45 | value, size, flags); |
| 46 | } | 46 | } |
| 47 | 47 | ||
diff --git a/fs/ext2/xattr_trusted.c b/fs/ext2/xattr_trusted.c index e8219f8eae9f..2a26d71f4771 100644 --- a/fs/ext2/xattr_trusted.c +++ b/fs/ext2/xattr_trusted.c | |||
| @@ -13,8 +13,8 @@ | |||
| 13 | #include "xattr.h" | 13 | #include "xattr.h" |
| 14 | 14 | ||
| 15 | static size_t | 15 | static size_t |
| 16 | ext2_xattr_trusted_list(struct inode *inode, char *list, size_t list_size, | 16 | ext2_xattr_trusted_list(struct dentry *dentry, char *list, size_t list_size, |
| 17 | const char *name, size_t name_len) | 17 | const char *name, size_t name_len, int type) |
| 18 | { | 18 | { |
| 19 | const int prefix_len = XATTR_TRUSTED_PREFIX_LEN; | 19 | const int prefix_len = XATTR_TRUSTED_PREFIX_LEN; |
| 20 | const size_t total_len = prefix_len + name_len + 1; | 20 | const size_t total_len = prefix_len + name_len + 1; |
| @@ -31,22 +31,22 @@ ext2_xattr_trusted_list(struct inode *inode, char *list, size_t list_size, | |||
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | static int | 33 | static int |
| 34 | ext2_xattr_trusted_get(struct inode *inode, const char *name, | 34 | ext2_xattr_trusted_get(struct dentry *dentry, const char *name, |
| 35 | void *buffer, size_t size) | 35 | void *buffer, size_t size, int type) |
| 36 | { | 36 | { |
| 37 | if (strcmp(name, "") == 0) | 37 | if (strcmp(name, "") == 0) |
| 38 | return -EINVAL; | 38 | return -EINVAL; |
| 39 | return ext2_xattr_get(inode, EXT2_XATTR_INDEX_TRUSTED, name, | 39 | return ext2_xattr_get(dentry->d_inode, EXT2_XATTR_INDEX_TRUSTED, name, |
| 40 | buffer, size); | 40 | buffer, size); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | static int | 43 | static int |
| 44 | ext2_xattr_trusted_set(struct inode *inode, const char *name, | 44 | ext2_xattr_trusted_set(struct dentry *dentry, const char *name, |
| 45 | const void *value, size_t size, int flags) | 45 | const void *value, size_t size, int flags, int type) |
| 46 | { | 46 | { |
| 47 | if (strcmp(name, "") == 0) | 47 | if (strcmp(name, "") == 0) |
| 48 | return -EINVAL; | 48 | return -EINVAL; |
| 49 | return ext2_xattr_set(inode, EXT2_XATTR_INDEX_TRUSTED, name, | 49 | return ext2_xattr_set(dentry->d_inode, EXT2_XATTR_INDEX_TRUSTED, name, |
| 50 | value, size, flags); | 50 | value, size, flags); |
| 51 | } | 51 | } |
| 52 | 52 | ||
diff --git a/fs/ext2/xattr_user.c b/fs/ext2/xattr_user.c index 92495d28c62f..3f6caf3684b4 100644 --- a/fs/ext2/xattr_user.c +++ b/fs/ext2/xattr_user.c | |||
| @@ -12,13 +12,13 @@ | |||
| 12 | #include "xattr.h" | 12 | #include "xattr.h" |
| 13 | 13 | ||
| 14 | static size_t | 14 | static size_t |
| 15 | ext2_xattr_user_list(struct inode *inode, char *list, size_t list_size, | 15 | ext2_xattr_user_list(struct dentry *dentry, char *list, size_t list_size, |
| 16 | const char *name, size_t name_len) | 16 | const char *name, size_t name_len, int type) |
| 17 | { | 17 | { |
| 18 | const size_t prefix_len = XATTR_USER_PREFIX_LEN; | 18 | const size_t prefix_len = XATTR_USER_PREFIX_LEN; |
| 19 | const size_t total_len = prefix_len + name_len + 1; | 19 | const size_t total_len = prefix_len + name_len + 1; |
| 20 | 20 | ||
| 21 | if (!test_opt(inode->i_sb, XATTR_USER)) | 21 | if (!test_opt(dentry->d_sb, XATTR_USER)) |
| 22 | return 0; | 22 | return 0; |
| 23 | 23 | ||
| 24 | if (list && total_len <= list_size) { | 24 | if (list && total_len <= list_size) { |
| @@ -30,27 +30,28 @@ ext2_xattr_user_list(struct inode *inode, char *list, size_t list_size, | |||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | static int | 32 | static int |
| 33 | ext2_xattr_user_get(struct inode *inode, const char *name, | 33 | ext2_xattr_user_get(struct dentry *dentry, const char *name, |
| 34 | void *buffer, size_t size) | 34 | void *buffer, size_t size, int type) |
| 35 | { | 35 | { |
| 36 | if (strcmp(name, "") == 0) | 36 | if (strcmp(name, "") == 0) |
| 37 | return -EINVAL; | 37 | return -EINVAL; |
| 38 | if (!test_opt(inode->i_sb, XATTR_USER)) | 38 | if (!test_opt(dentry->d_sb, XATTR_USER)) |
| 39 | return -EOPNOTSUPP; | 39 | return -EOPNOTSUPP; |
| 40 | return ext2_xattr_get(inode, EXT2_XATTR_INDEX_USER, name, buffer, size); | 40 | return ext2_xattr_get(dentry->d_inode, EXT2_XATTR_INDEX_USER, |
| 41 | name, buffer, size); | ||
| 41 | } | 42 | } |
| 42 | 43 | ||
| 43 | static int | 44 | static int |
| 44 | ext2_xattr_user_set(struct inode *inode, const char *name, | 45 | ext2_xattr_user_set(struct dentry *dentry, const char *name, |
| 45 | const void *value, size_t size, int flags) | 46 | const void *value, size_t size, int flags, int type) |
| 46 | { | 47 | { |
| 47 | if (strcmp(name, "") == 0) | 48 | if (strcmp(name, "") == 0) |
| 48 | return -EINVAL; | 49 | return -EINVAL; |
| 49 | if (!test_opt(inode->i_sb, XATTR_USER)) | 50 | if (!test_opt(dentry->d_sb, XATTR_USER)) |
| 50 | return -EOPNOTSUPP; | 51 | return -EOPNOTSUPP; |
| 51 | 52 | ||
| 52 | return ext2_xattr_set(inode, EXT2_XATTR_INDEX_USER, name, | 53 | return ext2_xattr_set(dentry->d_inode, EXT2_XATTR_INDEX_USER, |
| 53 | value, size, flags); | 54 | name, value, size, flags); |
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | struct xattr_handler ext2_xattr_user_handler = { | 57 | struct xattr_handler ext2_xattr_user_handler = { |
