ext4: sanity check the block and cluster size at mount time
[firefly-linux-kernel-4.4.55.git] / fs / ocfs2 / xattr.c
index ebfdea78659b1bda5a93674837e8f818c2503d44..877830b05e127c4c27f094d8a2c3fe059137a806 100644 (file)
@@ -7197,12 +7197,10 @@ out:
  */
 int ocfs2_init_security_and_acl(struct inode *dir,
                                struct inode *inode,
-                               const struct qstr *qstr,
-                               struct posix_acl *default_acl,
-                               struct posix_acl *acl)
+                               const struct qstr *qstr)
 {
-       struct buffer_head *dir_bh = NULL;
        int ret = 0;
+       struct buffer_head *dir_bh = NULL;
 
        ret = ocfs2_init_security_get(inode, dir, qstr, NULL);
        if (ret) {
@@ -7215,11 +7213,9 @@ int ocfs2_init_security_and_acl(struct inode *dir,
                mlog_errno(ret);
                goto leave;
        }
-
-       if (!ret && default_acl)
-               ret = ocfs2_iop_set_acl(inode, default_acl, ACL_TYPE_DEFAULT);
-       if (!ret && acl)
-               ret = ocfs2_iop_set_acl(inode, acl, ACL_TYPE_ACCESS);
+       ret = ocfs2_init_acl(NULL, inode, dir, NULL, dir_bh, NULL, NULL);
+       if (ret)
+               mlog_errno(ret);
 
        ocfs2_inode_unlock(dir, 0);
        brelse(dir_bh);
@@ -7229,9 +7225,10 @@ leave:
 /*
  * 'security' attributes support
  */
-static size_t ocfs2_xattr_security_list(struct dentry *dentry, char *list,
+static size_t ocfs2_xattr_security_list(const struct xattr_handler *handler,
+                                       struct dentry *dentry, char *list,
                                        size_t list_size, const char *name,
-                                       size_t name_len, int type)
+                                       size_t name_len)
 {
        const size_t prefix_len = XATTR_SECURITY_PREFIX_LEN;
        const size_t total_len = prefix_len + name_len + 1;
@@ -7244,8 +7241,9 @@ static size_t ocfs2_xattr_security_list(struct dentry *dentry, char *list,
        return total_len;
 }
 
-static int ocfs2_xattr_security_get(struct dentry *dentry, const char *name,
-                                   void *buffer, size_t size, int type)
+static int ocfs2_xattr_security_get(const struct xattr_handler *handler,
+                                   struct dentry *dentry, const char *name,
+                                   void *buffer, size_t size)
 {
        if (strcmp(name, "") == 0)
                return -EINVAL;
@@ -7253,8 +7251,9 @@ static int ocfs2_xattr_security_get(struct dentry *dentry, const char *name,
                               name, buffer, size);
 }
 
-static int ocfs2_xattr_security_set(struct dentry *dentry, const char *name,
-               const void *value, size_t size, int flags, int type)
+static int ocfs2_xattr_security_set(const struct xattr_handler *handler,
+                                   struct dentry *dentry, const char *name,
+                                   const void *value, size_t size, int flags)
 {
        if (strcmp(name, "") == 0)
                return -EINVAL;
@@ -7319,9 +7318,10 @@ const struct xattr_handler ocfs2_xattr_security_handler = {
 /*
  * 'trusted' attributes support
  */
-static size_t ocfs2_xattr_trusted_list(struct dentry *dentry, char *list,
+static size_t ocfs2_xattr_trusted_list(const struct xattr_handler *handler,
+                                      struct dentry *dentry, char *list,
                                       size_t list_size, const char *name,
-                                      size_t name_len, int type)
+                                      size_t name_len)
 {
        const size_t prefix_len = XATTR_TRUSTED_PREFIX_LEN;
        const size_t total_len = prefix_len + name_len + 1;
@@ -7337,8 +7337,9 @@ static size_t ocfs2_xattr_trusted_list(struct dentry *dentry, char *list,
        return total_len;
 }
 
-static int ocfs2_xattr_trusted_get(struct dentry *dentry, const char *name,
-               void *buffer, size_t size, int type)
+static int ocfs2_xattr_trusted_get(const struct xattr_handler *handler,
+                                  struct dentry *dentry, const char *name,
+                                  void *buffer, size_t size)
 {
        if (strcmp(name, "") == 0)
                return -EINVAL;
@@ -7346,8 +7347,9 @@ static int ocfs2_xattr_trusted_get(struct dentry *dentry, const char *name,
                               name, buffer, size);
 }
 
-static int ocfs2_xattr_trusted_set(struct dentry *dentry, const char *name,
-               const void *value, size_t size, int flags, int type)
+static int ocfs2_xattr_trusted_set(const struct xattr_handler *handler,
+                                  struct dentry *dentry, const char *name,
+                                  const void *value, size_t size, int flags)
 {
        if (strcmp(name, "") == 0)
                return -EINVAL;
@@ -7366,9 +7368,10 @@ const struct xattr_handler ocfs2_xattr_trusted_handler = {
 /*
  * 'user' attributes support
  */
-static size_t ocfs2_xattr_user_list(struct dentry *dentry, char *list,
+static size_t ocfs2_xattr_user_list(const struct xattr_handler *handler,
+                                   struct dentry *dentry, char *list,
                                    size_t list_size, const char *name,
-                                   size_t name_len, int type)
+                                   size_t name_len)
 {
        const size_t prefix_len = XATTR_USER_PREFIX_LEN;
        const size_t total_len = prefix_len + name_len + 1;
@@ -7385,8 +7388,9 @@ static size_t ocfs2_xattr_user_list(struct dentry *dentry, char *list,
        return total_len;
 }
 
-static int ocfs2_xattr_user_get(struct dentry *dentry, const char *name,
-               void *buffer, size_t size, int type)
+static int ocfs2_xattr_user_get(const struct xattr_handler *handler,
+                               struct dentry *dentry, const char *name,
+                               void *buffer, size_t size)
 {
        struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb);
 
@@ -7398,8 +7402,9 @@ static int ocfs2_xattr_user_get(struct dentry *dentry, const char *name,
                               buffer, size);
 }
 
-static int ocfs2_xattr_user_set(struct dentry *dentry, const char *name,
-               const void *value, size_t size, int flags, int type)
+static int ocfs2_xattr_user_set(const struct xattr_handler *handler,
+                               struct dentry *dentry, const char *name,
+                               const void *value, size_t size, int flags)
 {
        struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb);