summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3121aaa)
Kudos to Andre Renaud <andre@ignavus.net>
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
#define YAFFS_USE_DIR_ITERATE
#endif
#define YAFFS_USE_DIR_ITERATE
#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0))
+#define YAFFS_USE_XATTR
+#endif
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
#define YAFFS_NEW_PROCFS
#include <linux/seq_file.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
#define YAFFS_NEW_PROCFS
#include <linux/seq_file.h>
(dir)->i_ctime = (dir)->i_mtime = CURRENT_TIME; \
} while (0)
(dir)->i_ctime = (dir)->i_mtime = CURRENT_TIME; \
} while (0)
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0))
+static inline int setattr_prepare(struct dentry *dentry, struct iattr *attr)
+{
+ return inode_change_ok(dentry->d_inode, attr);
+}
+#endif
+
static void yaffs_fill_inode_from_obj(struct inode *inode,
struct yaffs_obj *obj);
static void yaffs_fill_inode_from_obj(struct inode *inode,
struct yaffs_obj *obj);
- error = inode_change_ok(inode, attr);
+ error = setattr_prepare(dentry, attr);
if (error == 0) {
int result;
if (!error) {
if (error == 0) {
int result;
if (!error) {
#if (YAFFS_NEW_XATTR > 0)
static int yaffs_setxattr(struct dentry *dentry, struct inode *inode,
const char *name, const void *value, size_t size, int flags)
#if (YAFFS_NEW_XATTR > 0)
static int yaffs_setxattr(struct dentry *dentry, struct inode *inode,
const char *name, const void *value, size_t size, int flags)
static ssize_t yaffs_listxattr(struct dentry * dentry, char *buff, size_t size)
{
static ssize_t yaffs_listxattr(struct dentry * dentry, char *buff, size_t size)
{
static const struct inode_operations yaffs_file_inode_operations = {
.setattr = yaffs_setattr,
static const struct inode_operations yaffs_file_inode_operations = {
.setattr = yaffs_setattr,
.setxattr = yaffs_setxattr,
.getxattr = yaffs_getxattr,
.setxattr = yaffs_setxattr,
.getxattr = yaffs_getxattr,
- .listxattr = yaffs_listxattr,
.removexattr = yaffs_removexattr,
.removexattr = yaffs_removexattr,
+#endif
+ .listxattr = yaffs_listxattr,
.put_link = yaffs_put_link,
#endif
.setattr = yaffs_setattr,
.put_link = yaffs_put_link,
#endif
.setattr = yaffs_setattr,
.setxattr = yaffs_setxattr,
.getxattr = yaffs_getxattr,
.setxattr = yaffs_setxattr,
.getxattr = yaffs_getxattr,
- .listxattr = yaffs_listxattr,
.removexattr = yaffs_removexattr,
.removexattr = yaffs_removexattr,
+#endif
+ .listxattr = yaffs_listxattr,
};
#ifdef YAFFS_USE_OWN_IGET
};
#ifdef YAFFS_USE_OWN_IGET
*
* NB: POSIX says you can rename an object over an old object of the same name
*/
*
* NB: POSIX says you can rename an object over an old object of the same name
*/
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
+static int yaffs_rename(struct inode *old_dir, struct dentry *old_dentry,
+ struct inode *new_dir, struct dentry *new_dentry, unsigned int unused)
+#else
static int yaffs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
static int yaffs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
{
struct yaffs_dev *dev;
int ret_val = YAFFS_FAIL;
{
struct yaffs_dev *dev;
int ret_val = YAFFS_FAIL;
.mknod = yaffs_mknod,
.rename = yaffs_rename,
.setattr = yaffs_setattr,
.mknod = yaffs_mknod,
.rename = yaffs_rename,
.setattr = yaffs_setattr,
+ .listxattr = yaffs_listxattr,
+#ifdef YAFFS_USE_XATTR
.setxattr = yaffs_setxattr,
.getxattr = yaffs_getxattr,
.setxattr = yaffs_setxattr,
.getxattr = yaffs_getxattr,
- .listxattr = yaffs_listxattr,
.removexattr = yaffs_removexattr,
.removexattr = yaffs_removexattr,
};
/*-----------------------------------------------------------------*/
};
/*-----------------------------------------------------------------*/