diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2012-11-30 03:32:08 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2012-12-10 23:43:43 -0500 |
commit | 573ea5fcf0a65fea4811f82edd6dc6045c04edda (patch) | |
tree | 8c2e5cfcd8cb2d868422d90a49b86a5c49d7da91 /fs/f2fs | |
parent | 0a8165d7c2cf1395059db20ab07665baf3758fcd (diff) |
f2fs: resolve build failures
There exist two build failures reported by Randy Dunlap as follows.
(on i386)
a. (config-r8857)
ERROR: "f2fs_xattr_advise_handler" [fs/f2fs/f2fs.ko] undefined!
Key configs in (config-r8857) are as follows.
CONFIG_F2FS_FS=m
# CONFIG_F2FS_STAT_FS is not set
CONFIG_F2FS_FS_XATTR=y
# CONFIG_F2FS_FS_POSIX_ACL is not set
The error was occurred due to the function location that we made a mistake.
Recently we added a new functionality for users to indicate cold files
explicitly through xattr operations (i.e., f2fs_xattr_advise_handler).
This handler should have been added in xattr.c instead of acl.c in order
to avoid an undefined operation like in this case where XATTR is set and
ACL is not set.
b. (config-r8855)
fs/f2fs/file.c: In function 'f2fs_vm_page_mkwrite':
fs/f2fs/file.c:97:2: error: implicit declaration of function
'block_page_mkwrite_return'
Key config in (config-r8855) is CONFIG_BLOCK.
Obviously, f2fs works on top of the block device so that we should consider
carefully a sort of config dependencies.
The reason why this error was occurred was that f2fs_vm_page_mkwrite() calls
block_page_mkwrite_return() which is enalbed only if CONFIG_BLOCK is set.
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/Kconfig | 1 | ||||
-rw-r--r-- | fs/f2fs/acl.c | 51 | ||||
-rw-r--r-- | fs/f2fs/xattr.c | 51 |
3 files changed, 52 insertions, 51 deletions
diff --git a/fs/f2fs/Kconfig b/fs/f2fs/Kconfig index 37a6b8e9438f..fd27e7e6326e 100644 --- a/fs/f2fs/Kconfig +++ b/fs/f2fs/Kconfig | |||
@@ -1,5 +1,6 @@ | |||
1 | config F2FS_FS | 1 | config F2FS_FS |
2 | tristate "F2FS filesystem support (EXPERIMENTAL)" | 2 | tristate "F2FS filesystem support (EXPERIMENTAL)" |
3 | depends on BLOCK | ||
3 | help | 4 | help |
4 | F2FS is based on Log-structured File System (LFS), which supports | 5 | F2FS is based on Log-structured File System (LFS), which supports |
5 | versatile "flash-friendly" features. The design has been focused on | 6 | versatile "flash-friendly" features. The design has been focused on |
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index 1ac9a4b24f6e..fed74d193ffb 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c | |||
@@ -412,54 +412,3 @@ const struct xattr_handler f2fs_xattr_acl_access_handler = { | |||
412 | .get = f2fs_xattr_get_acl, | 412 | .get = f2fs_xattr_get_acl, |
413 | .set = f2fs_xattr_set_acl, | 413 | .set = f2fs_xattr_set_acl, |
414 | }; | 414 | }; |
415 | |||
416 | static size_t f2fs_xattr_advise_list(struct dentry *dentry, char *list, | ||
417 | size_t list_size, const char *name, size_t name_len, int type) | ||
418 | { | ||
419 | const char *xname = F2FS_SYSTEM_ADVISE_PREFIX; | ||
420 | size_t size; | ||
421 | |||
422 | if (type != F2FS_XATTR_INDEX_ADVISE) | ||
423 | return 0; | ||
424 | |||
425 | size = strlen(xname) + 1; | ||
426 | if (list && size <= list_size) | ||
427 | memcpy(list, xname, size); | ||
428 | return size; | ||
429 | } | ||
430 | |||
431 | static int f2fs_xattr_advise_get(struct dentry *dentry, const char *name, | ||
432 | void *buffer, size_t size, int type) | ||
433 | { | ||
434 | struct inode *inode = dentry->d_inode; | ||
435 | |||
436 | if (strcmp(name, "") != 0) | ||
437 | return -EINVAL; | ||
438 | |||
439 | *((char *)buffer) = F2FS_I(inode)->i_advise; | ||
440 | return sizeof(char); | ||
441 | } | ||
442 | |||
443 | static int f2fs_xattr_advise_set(struct dentry *dentry, const char *name, | ||
444 | const void *value, size_t size, int flags, int type) | ||
445 | { | ||
446 | struct inode *inode = dentry->d_inode; | ||
447 | |||
448 | if (strcmp(name, "") != 0) | ||
449 | return -EINVAL; | ||
450 | if (!inode_owner_or_capable(inode)) | ||
451 | return -EPERM; | ||
452 | if (value == NULL) | ||
453 | return -EINVAL; | ||
454 | |||
455 | F2FS_I(inode)->i_advise |= *(char *)value; | ||
456 | return 0; | ||
457 | } | ||
458 | |||
459 | const struct xattr_handler f2fs_xattr_advise_handler = { | ||
460 | .prefix = F2FS_SYSTEM_ADVISE_PREFIX, | ||
461 | .flags = F2FS_XATTR_INDEX_ADVISE, | ||
462 | .list = f2fs_xattr_advise_list, | ||
463 | .get = f2fs_xattr_advise_get, | ||
464 | .set = f2fs_xattr_advise_set, | ||
465 | }; | ||
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 5324d1e9d168..7d52e8dc0c59 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c | |||
@@ -102,6 +102,49 @@ static int f2fs_xattr_generic_set(struct dentry *dentry, const char *name, | |||
102 | return f2fs_setxattr(dentry->d_inode, type, name, value, size); | 102 | return f2fs_setxattr(dentry->d_inode, type, name, value, size); |
103 | } | 103 | } |
104 | 104 | ||
105 | static size_t f2fs_xattr_advise_list(struct dentry *dentry, char *list, | ||
106 | size_t list_size, const char *name, size_t name_len, int type) | ||
107 | { | ||
108 | const char *xname = F2FS_SYSTEM_ADVISE_PREFIX; | ||
109 | size_t size; | ||
110 | |||
111 | if (type != F2FS_XATTR_INDEX_ADVISE) | ||
112 | return 0; | ||
113 | |||
114 | size = strlen(xname) + 1; | ||
115 | if (list && size <= list_size) | ||
116 | memcpy(list, xname, size); | ||
117 | return size; | ||
118 | } | ||
119 | |||
120 | static int f2fs_xattr_advise_get(struct dentry *dentry, const char *name, | ||
121 | void *buffer, size_t size, int type) | ||
122 | { | ||
123 | struct inode *inode = dentry->d_inode; | ||
124 | |||
125 | if (strcmp(name, "") != 0) | ||
126 | return -EINVAL; | ||
127 | |||
128 | *((char *)buffer) = F2FS_I(inode)->i_advise; | ||
129 | return sizeof(char); | ||
130 | } | ||
131 | |||
132 | static int f2fs_xattr_advise_set(struct dentry *dentry, const char *name, | ||
133 | const void *value, size_t size, int flags, int type) | ||
134 | { | ||
135 | struct inode *inode = dentry->d_inode; | ||
136 | |||
137 | if (strcmp(name, "") != 0) | ||
138 | return -EINVAL; | ||
139 | if (!inode_owner_or_capable(inode)) | ||
140 | return -EPERM; | ||
141 | if (value == NULL) | ||
142 | return -EINVAL; | ||
143 | |||
144 | F2FS_I(inode)->i_advise |= *(char *)value; | ||
145 | return 0; | ||
146 | } | ||
147 | |||
105 | const struct xattr_handler f2fs_xattr_user_handler = { | 148 | const struct xattr_handler f2fs_xattr_user_handler = { |
106 | .prefix = XATTR_USER_PREFIX, | 149 | .prefix = XATTR_USER_PREFIX, |
107 | .flags = F2FS_XATTR_INDEX_USER, | 150 | .flags = F2FS_XATTR_INDEX_USER, |
@@ -118,6 +161,14 @@ const struct xattr_handler f2fs_xattr_trusted_handler = { | |||
118 | .set = f2fs_xattr_generic_set, | 161 | .set = f2fs_xattr_generic_set, |
119 | }; | 162 | }; |
120 | 163 | ||
164 | const struct xattr_handler f2fs_xattr_advise_handler = { | ||
165 | .prefix = F2FS_SYSTEM_ADVISE_PREFIX, | ||
166 | .flags = F2FS_XATTR_INDEX_ADVISE, | ||
167 | .list = f2fs_xattr_advise_list, | ||
168 | .get = f2fs_xattr_advise_get, | ||
169 | .set = f2fs_xattr_advise_set, | ||
170 | }; | ||
171 | |||
121 | static const struct xattr_handler *f2fs_xattr_handler_map[] = { | 172 | static const struct xattr_handler *f2fs_xattr_handler_map[] = { |
122 | [F2FS_XATTR_INDEX_USER] = &f2fs_xattr_user_handler, | 173 | [F2FS_XATTR_INDEX_USER] = &f2fs_xattr_user_handler, |
123 | #ifdef CONFIG_F2FS_FS_POSIX_ACL | 174 | #ifdef CONFIG_F2FS_FS_POSIX_ACL |