Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Dec 2009 20:59:11 +0000 (12:59 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Dec 2009 20:59:11 +0000 (12:59 -0800)
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
  ocfs2/trivial: Use le16_to_cpu for a disk value in xattr.c
  ocfs2/trivial: Use proper mask for 2 places in hearbeat.c
  Ocfs2: Let ocfs2 support fiemap for symlink and fast symlink.
  Ocfs2: Should ocfs2 support fiemap for S_IFDIR inode?
  ocfs2: Use FIEMAP_EXTENT_SHARED
  fiemap: Add new extent flag FIEMAP_EXTENT_SHARED
  ocfs2: replace u8 by __u8 in ocfs2_fs.h
  ocfs2: explicit declare uninitialized var in user_cluster_connect()
  ocfs2-devel: remove redundant OCFS2_MOUNT_POSIX_ACL check in ocfs2_get_acl_nolock()
  ocfs2: return -EAGAIN instead of EAGAIN in dlm
  ocfs2/cluster: Make fence method configurable - v2
  ocfs2: Set MS_POSIXACL on remount
  ocfs2: Make acl use the default
  ocfs2: Always include ACL support

1  2 
fs/ocfs2/acl.c
fs/ocfs2/namei.c
fs/ocfs2/ocfs2.h
fs/ocfs2/super.c
fs/ocfs2/xattr.c

diff --combined fs/ocfs2/acl.c
index e3e47415d85164d8bf086ef28ddba3e359214fc3,200b88109b297305db0928472f234e5f858e429a..0501974bedd0d3b96764b48b5725054fbe7ca412
@@@ -98,15 -98,11 +98,11 @@@ static struct posix_acl *ocfs2_get_acl_
                                              int type,
                                              struct buffer_head *di_bh)
  {
-       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
        int name_index;
        char *value = NULL;
        struct posix_acl *acl;
        int retval;
  
-       if (!(osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL))
-               return NULL;
        switch (type) {
        case ACL_TYPE_ACCESS:
                name_index = OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS;
@@@ -331,14 -327,13 +327,14 @@@ cleanup
        return ret;
  }
  
 -static size_t ocfs2_xattr_list_acl_access(struct inode *inode,
 +static size_t ocfs2_xattr_list_acl_access(struct dentry *dentry,
                                          char *list,
                                          size_t list_len,
                                          const char *name,
 -                                        size_t name_len)
 +                                        size_t name_len,
 +                                        int type)
  {
 -      struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 +      struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb);
        const size_t size = sizeof(POSIX_ACL_XATTR_ACCESS);
  
        if (!(osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL))
        return size;
  }
  
 -static size_t ocfs2_xattr_list_acl_default(struct inode *inode,
 +static size_t ocfs2_xattr_list_acl_default(struct dentry *dentry,
                                           char *list,
                                           size_t list_len,
                                           const char *name,
 -                                         size_t name_len)
 +                                         size_t name_len,
 +                                         int type)
  {
 -      struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 +      struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb);
        const size_t size = sizeof(POSIX_ACL_XATTR_DEFAULT);
  
        if (!(osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL))
        return size;
  }
  
 -static int ocfs2_xattr_get_acl(struct inode *inode,
 -                             int type,
 -                             void *buffer,
 -                             size_t size)
 +static int ocfs2_xattr_get_acl(struct dentry *dentry, const char *name,
 +              void *buffer, size_t size, int type)
  {
 -      struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 +      struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb);
        struct posix_acl *acl;
        int ret;
  
 +      if (strcmp(name, "") != 0)
 +              return -EINVAL;
        if (!(osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL))
                return -EOPNOTSUPP;
  
 -      acl = ocfs2_get_acl(inode, type);
 +      acl = ocfs2_get_acl(dentry->d_inode, type);
        if (IS_ERR(acl))
                return PTR_ERR(acl);
        if (acl == NULL)
        return ret;
  }
  
 -static int ocfs2_xattr_get_acl_access(struct inode *inode,
 -                                    const char *name,
 -                                    void *buffer,
 -                                    size_t size)
 -{
 -      if (strcmp(name, "") != 0)
 -              return -EINVAL;
 -      return ocfs2_xattr_get_acl(inode, ACL_TYPE_ACCESS, buffer, size);
 -}
 -
 -static int ocfs2_xattr_get_acl_default(struct inode *inode,
 -                                     const char *name,
 -                                     void *buffer,
 -                                     size_t size)
 -{
 -      if (strcmp(name, "") != 0)
 -              return -EINVAL;
 -      return ocfs2_xattr_get_acl(inode, ACL_TYPE_DEFAULT, buffer, size);
 -}
 -
 -static int ocfs2_xattr_set_acl(struct inode *inode,
 -                             int type,
 -                             const void *value,
 -                             size_t size)
 +static int ocfs2_xattr_set_acl(struct dentry *dentry, const char *name,
 +              const void *value, size_t size, int flags, int type)
  {
 +      struct inode *inode = dentry->d_inode;
        struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
        struct posix_acl *acl;
        int ret = 0;
  
 +      if (strcmp(name, "") != 0)
 +              return -EINVAL;
        if (!(osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL))
                return -EOPNOTSUPP;
  
@@@ -425,18 -438,38 +421,18 @@@ cleanup
        return ret;
  }
  
 -static int ocfs2_xattr_set_acl_access(struct inode *inode,
 -                                    const char *name,
 -                                    const void *value,
 -                                    size_t size,
 -                                    int flags)
 -{
 -      if (strcmp(name, "") != 0)
 -              return -EINVAL;
 -      return ocfs2_xattr_set_acl(inode, ACL_TYPE_ACCESS, value, size);
 -}
 -
 -static int ocfs2_xattr_set_acl_default(struct inode *inode,
 -                                     const char *name,
 -                                     const void *value,
 -                                     size_t size,
 -                                     int flags)
 -{
 -      if (strcmp(name, "") != 0)
 -              return -EINVAL;
 -      return ocfs2_xattr_set_acl(inode, ACL_TYPE_DEFAULT, value, size);
 -}
 -
  struct xattr_handler ocfs2_xattr_acl_access_handler = {
        .prefix = POSIX_ACL_XATTR_ACCESS,
 +      .flags  = ACL_TYPE_ACCESS,
        .list   = ocfs2_xattr_list_acl_access,
 -      .get    = ocfs2_xattr_get_acl_access,
 -      .set    = ocfs2_xattr_set_acl_access,
 +      .get    = ocfs2_xattr_get_acl,
 +      .set    = ocfs2_xattr_set_acl,
  };
  
  struct xattr_handler ocfs2_xattr_acl_default_handler = {
        .prefix = POSIX_ACL_XATTR_DEFAULT,
 +      .flags  = ACL_TYPE_DEFAULT,
        .list   = ocfs2_xattr_list_acl_default,
 -      .get    = ocfs2_xattr_get_acl_default,
 -      .set    = ocfs2_xattr_set_acl_default,
 +      .get    = ocfs2_xattr_get_acl,
 +      .set    = ocfs2_xattr_set_acl,
  };
diff --combined fs/ocfs2/namei.c
index 3e9b46002f22ba384f2f99a477da41be202e6de2,0b9f35e09bf8640d3f940eb60015c198a5792a8b..50fb26a6a5f55f88a93c84e29b9d4386e181cbdb
@@@ -2108,7 -2108,6 +2108,7 @@@ int ocfs2_create_inode_in_orphan(struc
        }
        did_quota_inode = 1;
  
 +      inode->i_nlink = 0;
        /* do the real work now. */
        status = ocfs2_mknod_locked(osb, dir, inode,
                                    0, &new_di_bh, parent_di_bh, handle,
        if (status < 0)
                mlog_errno(status);
  
 +      insert_inode_hash(inode);
  leave:
        if (status < 0 && did_quota_inode)
                vfs_dq_free_inode(inode);
@@@ -2269,8 -2267,6 +2269,8 @@@ int ocfs2_mv_orphaned_inode_to_new(stru
        di = (struct ocfs2_dinode *)di_bh->b_data;
        le32_add_cpu(&di->i_flags, -OCFS2_ORPHANED_FL);
        di->i_orphaned_slot = 0;
 +      inode->i_nlink = 1;
 +      ocfs2_set_links_count(di, inode->i_nlink);
        ocfs2_journal_dirty(handle, di_bh);
  
        status = ocfs2_add_entry(handle, dentry, inode,
                goto out_commit;
        }
  
 -      insert_inode_hash(inode);
        dentry->d_op = &ocfs2_dentry_ops;
        d_instantiate(dentry, inode);
        status = 0;
@@@ -2329,4 -2326,5 +2329,5 @@@ const struct inode_operations ocfs2_dir
        .getxattr       = generic_getxattr,
        .listxattr      = ocfs2_listxattr,
        .removexattr    = generic_removexattr,
+       .fiemap         = ocfs2_fiemap,
  };
diff --combined fs/ocfs2/ocfs2.h
index d963d863870994075b8af17c84484c09cb0b84d8,35ad46cf89b31f6a90edf1ad94bbd506e9ef7d20..9362eea7424be2421b461b76032d85733573c731
  #include <linux/kref.h>
  #include <linux/mutex.h>
  #include <linux/lockdep.h>
 -#ifndef CONFIG_OCFS2_COMPAT_JBD
 -# include <linux/jbd2.h>
 -#else
 -# include <linux/jbd.h>
 -# include "ocfs2_jbd_compat.h"
 -#endif
 +#include <linux/jbd2.h>
  
  /* For union ocfs2_dlm_lksb */
  #include "stackglue.h"
@@@ -245,9 -250,11 +245,11 @@@ enum ocfs2_mount_option
        OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */
        OCFS2_MOUNT_NOUSERXATTR = 1 << 6, /* No user xattr */
        OCFS2_MOUNT_INODE64 = 1 << 7,   /* Allow inode numbers > 2^32 */
-       OCFS2_MOUNT_POSIX_ACL = 1 << 8, /* POSIX access control lists */
-       OCFS2_MOUNT_USRQUOTA = 1 << 9, /* We support user quotas */
-       OCFS2_MOUNT_GRPQUOTA = 1 << 10, /* We support group quotas */
+       OCFS2_MOUNT_POSIX_ACL = 1 << 8, /* Force POSIX access control lists */
+       OCFS2_MOUNT_NO_POSIX_ACL = 1 << 9,      /* Disable POSIX access
+                                                  control lists */
+       OCFS2_MOUNT_USRQUOTA = 1 << 10, /* We support user quotas */
+       OCFS2_MOUNT_GRPQUOTA = 1 << 11, /* We support group quotas */
  };
  
  #define OCFS2_OSB_SOFT_RO                     0x0001
diff --combined fs/ocfs2/super.c
index 14f47d2bfe02eb6500666e8a63a227a2d4ee10f2,45d654cb77ef6af159edac36338c12e8cfdc4283..26069917a9f51752a18c8dea60940d0b00ca1054
@@@ -100,6 -100,8 +100,8 @@@ struct mount_option
  static int ocfs2_parse_options(struct super_block *sb, char *options,
                               struct mount_options *mopt,
                               int is_remount);
+ static int ocfs2_check_set_options(struct super_block *sb,
+                                  struct mount_options *options);
  static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt);
  static void ocfs2_put_super(struct super_block *sb);
  static int ocfs2_mount_volume(struct super_block *sb);
@@@ -600,7 -602,8 +602,8 @@@ static int ocfs2_remount(struct super_b
  
        lock_kernel();
  
-       if (!ocfs2_parse_options(sb, data, &parsed_options, 1)) {
+       if (!ocfs2_parse_options(sb, data, &parsed_options, 1) ||
+           !ocfs2_check_set_options(sb, &parsed_options)) {
                ret = -EINVAL;
                goto out;
        }
@@@ -691,8 -694,6 +694,6 @@@ unlock_osb
        if (!ret) {
                /* Only save off the new mount options in case of a successful
                 * remount. */
-               if (!(osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_XATTR))
-                       parsed_options.mount_opt &= ~OCFS2_MOUNT_POSIX_ACL;
                osb->s_mount_opt = parsed_options.mount_opt;
                osb->s_atime_quantum = parsed_options.atime_quantum;
                osb->preferred_slot = parsed_options.slot;
  
                if (!ocfs2_is_hard_readonly(osb))
                        ocfs2_set_journal_params(osb);
+               sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
+                       ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ?
+                                                       MS_POSIXACL : 0);
        }
  out:
        unlock_kernel();
@@@ -1011,31 -1016,16 +1016,16 @@@ static int ocfs2_fill_super(struct supe
        brelse(bh);
        bh = NULL;
  
-       if (!(osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_XATTR))
-               parsed_options.mount_opt &= ~OCFS2_MOUNT_POSIX_ACL;
+       if (!ocfs2_check_set_options(sb, &parsed_options)) {
+               status = -EINVAL;
+               goto read_super_error;
+       }
        osb->s_mount_opt = parsed_options.mount_opt;
        osb->s_atime_quantum = parsed_options.atime_quantum;
        osb->preferred_slot = parsed_options.slot;
        osb->osb_commit_interval = parsed_options.commit_interval;
        osb->local_alloc_default_bits = ocfs2_megabytes_to_clusters(sb, parsed_options.localalloc_opt);
        osb->local_alloc_bits = osb->local_alloc_default_bits;
-       if (osb->s_mount_opt & OCFS2_MOUNT_USRQUOTA &&
-           !OCFS2_HAS_RO_COMPAT_FEATURE(sb,
-                                        OCFS2_FEATURE_RO_COMPAT_USRQUOTA)) {
-               status = -EINVAL;
-               mlog(ML_ERROR, "User quotas were requested, but this "
-                    "filesystem does not have the feature enabled.\n");
-               goto read_super_error;
-       }
-       if (osb->s_mount_opt & OCFS2_MOUNT_GRPQUOTA &&
-           !OCFS2_HAS_RO_COMPAT_FEATURE(sb,
-                                        OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)) {
-               status = -EINVAL;
-               mlog(ML_ERROR, "Group quotas were requested, but this "
-                    "filesystem does not have the feature enabled.\n");
-               goto read_super_error;
-       }
  
        status = ocfs2_verify_userspace_stack(osb, &parsed_options);
        if (status)
@@@ -1245,6 -1235,40 +1235,40 @@@ static struct file_system_type ocfs2_fs
        .next           = NULL
  };
  
+ static int ocfs2_check_set_options(struct super_block *sb,
+                                  struct mount_options *options)
+ {
+       if (options->mount_opt & OCFS2_MOUNT_USRQUOTA &&
+           !OCFS2_HAS_RO_COMPAT_FEATURE(sb,
+                                        OCFS2_FEATURE_RO_COMPAT_USRQUOTA)) {
+               mlog(ML_ERROR, "User quotas were requested, but this "
+                    "filesystem does not have the feature enabled.\n");
+               return 0;
+       }
+       if (options->mount_opt & OCFS2_MOUNT_GRPQUOTA &&
+           !OCFS2_HAS_RO_COMPAT_FEATURE(sb,
+                                        OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)) {
+               mlog(ML_ERROR, "Group quotas were requested, but this "
+                    "filesystem does not have the feature enabled.\n");
+               return 0;
+       }
+       if (options->mount_opt & OCFS2_MOUNT_POSIX_ACL &&
+           !OCFS2_HAS_INCOMPAT_FEATURE(sb, OCFS2_FEATURE_INCOMPAT_XATTR)) {
+               mlog(ML_ERROR, "ACL support requested but extended attributes "
+                    "feature is not enabled\n");
+               return 0;
+       }
+       /* No ACL setting specified? Use XATTR feature... */
+       if (!(options->mount_opt & (OCFS2_MOUNT_POSIX_ACL |
+                                   OCFS2_MOUNT_NO_POSIX_ACL))) {
+               if (OCFS2_HAS_INCOMPAT_FEATURE(sb, OCFS2_FEATURE_INCOMPAT_XATTR))
+                       options->mount_opt |= OCFS2_MOUNT_POSIX_ACL;
+               else
+                       options->mount_opt |= OCFS2_MOUNT_NO_POSIX_ACL;
+       }
+       return 1;
+ }
  static int ocfs2_parse_options(struct super_block *sb,
                               char *options,
                               struct mount_options *mopt,
                        mopt->mount_opt |= OCFS2_MOUNT_INODE64;
                        break;
                case Opt_usrquota:
-                       /* We check only on remount, otherwise features
-                        * aren't yet initialized. */
-                       if (is_remount && !OCFS2_HAS_RO_COMPAT_FEATURE(sb,
-                           OCFS2_FEATURE_RO_COMPAT_USRQUOTA)) {
-                               mlog(ML_ERROR, "User quota requested but "
-                                    "filesystem feature is not set\n");
-                               status = 0;
-                               goto bail;
-                       }
                        mopt->mount_opt |= OCFS2_MOUNT_USRQUOTA;
                        break;
                case Opt_grpquota:
-                       if (is_remount && !OCFS2_HAS_RO_COMPAT_FEATURE(sb,
-                           OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)) {
-                               mlog(ML_ERROR, "Group quota requested but "
-                                    "filesystem feature is not set\n");
-                               status = 0;
-                               goto bail;
-                       }
                        mopt->mount_opt |= OCFS2_MOUNT_GRPQUOTA;
                        break;
- #ifdef CONFIG_OCFS2_FS_POSIX_ACL
                case Opt_acl:
                        mopt->mount_opt |= OCFS2_MOUNT_POSIX_ACL;
+                       mopt->mount_opt &= ~OCFS2_MOUNT_NO_POSIX_ACL;
                        break;
                case Opt_noacl:
+                       mopt->mount_opt |= OCFS2_MOUNT_NO_POSIX_ACL;
                        mopt->mount_opt &= ~OCFS2_MOUNT_POSIX_ACL;
                        break;
- #else
-               case Opt_acl:
-               case Opt_noacl:
-                       printk(KERN_INFO "ocfs2 (no)acl options not supported\n");
-                       break;
- #endif
                default:
                        mlog(ML_ERROR,
                             "Unrecognized mount option \"%s\" "
@@@ -1502,12 -1505,10 +1505,10 @@@ static int ocfs2_show_options(struct se
        if (opts & OCFS2_MOUNT_INODE64)
                seq_printf(s, ",inode64");
  
- #ifdef CONFIG_OCFS2_FS_POSIX_ACL
        if (opts & OCFS2_MOUNT_POSIX_ACL)
                seq_printf(s, ",acl");
        else
                seq_printf(s, ",noacl");
- #endif
  
        return 0;
  }
@@@ -1647,10 -1648,6 +1648,10 @@@ static int ocfs2_statfs(struct dentry *
        buf->f_bavail = buf->f_bfree;
        buf->f_files = numbits;
        buf->f_ffree = freebits;
 +      buf->f_fsid.val[0] = crc32_le(0, osb->uuid_str, OCFS2_VOL_UUID_LEN)
 +                              & 0xFFFFFFFFUL;
 +      buf->f_fsid.val[1] = crc32_le(0, osb->uuid_str + OCFS2_VOL_UUID_LEN,
 +                              OCFS2_VOL_UUID_LEN) & 0xFFFFFFFFUL;
  
        brelse(bh);
  
diff --combined fs/ocfs2/xattr.c
index 43c114831c0dc82fc99487eab7a6d71bebe85a41,932c0773160861e905ff6269aff50de36384d76b..8fc6fb071c6d13c33dd24401a13308ab737e0b1a
@@@ -98,10 -98,8 +98,8 @@@ static struct ocfs2_xattr_def_value_roo
  
  struct xattr_handler *ocfs2_xattr_handlers[] = {
        &ocfs2_xattr_user_handler,
- #ifdef CONFIG_OCFS2_FS_POSIX_ACL
        &ocfs2_xattr_acl_access_handler,
        &ocfs2_xattr_acl_default_handler,
- #endif
        &ocfs2_xattr_trusted_handler,
        &ocfs2_xattr_security_handler,
        NULL
  
  static struct xattr_handler *ocfs2_xattr_handler_map[OCFS2_XATTR_MAX] = {
        [OCFS2_XATTR_INDEX_USER]        = &ocfs2_xattr_user_handler,
- #ifdef CONFIG_OCFS2_FS_POSIX_ACL
        [OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS]
                                        = &ocfs2_xattr_acl_access_handler,
        [OCFS2_XATTR_INDEX_POSIX_ACL_DEFAULT]
                                        = &ocfs2_xattr_acl_default_handler,
- #endif
        [OCFS2_XATTR_INDEX_TRUSTED]     = &ocfs2_xattr_trusted_handler,
        [OCFS2_XATTR_INDEX_SECURITY]    = &ocfs2_xattr_security_handler,
  };
@@@ -205,6 -201,8 +201,6 @@@ static int ocfs2_get_xattr_tree_value_r
                                           int offset,
                                           struct ocfs2_xattr_value_root **xv,
                                           struct buffer_head **bh);
 -static int ocfs2_xattr_security_set(struct inode *inode, const char *name,
 -                                  const void *value, size_t size, int flags);
  
  static inline u16 ocfs2_xattr_buckets_per_cluster(struct ocfs2_super *osb)
  {
@@@ -6064,7 -6062,7 +6060,7 @@@ static int ocfs2_value_metas_in_xattr_h
                 * to the extent block, so just calculate a maximum record num.
                 */
                if (!xv->xr_list.l_tree_depth)
-                       *num_recs += xv->xr_list.l_next_free_rec;
+                       *num_recs += le16_to_cpu(xv->xr_list.l_next_free_rec);
                else
                        *num_recs += ocfs2_clusters_for_bytes(sb,
                                                              XATTR_SIZE_MAX);
@@@ -6976,9 -6974,9 +6972,9 @@@ int ocfs2_init_security_and_acl(struct 
  
        ret = ocfs2_init_security_get(inode, dir, &si);
        if (!ret) {
 -              ret = ocfs2_xattr_security_set(inode, si.name,
 -                                             si.value, si.value_len,
 -                                             XATTR_CREATE);
 +              ret = ocfs2_xattr_set(inode, OCFS2_XATTR_INDEX_SECURITY,
 +                                    si.name, si.value, si.value_len,
 +                                    XATTR_CREATE);
                if (ret) {
                        mlog_errno(ret);
                        goto leave;
@@@ -7006,9 -7004,9 +7002,9 @@@ leave
  /*
   * 'security' attributes support
   */
 -static size_t ocfs2_xattr_security_list(struct inode *inode, char *list,
 +static size_t ocfs2_xattr_security_list(struct dentry *dentry, char *list,
                                        size_t list_size, const char *name,
 -                                      size_t name_len)
 +                                      size_t name_len, int type)
  {
        const size_t prefix_len = XATTR_SECURITY_PREFIX_LEN;
        const size_t total_len = prefix_len + name_len + 1;
        return total_len;
  }
  
 -static int ocfs2_xattr_security_get(struct inode *inode, const char *name,
 -                                  void *buffer, size_t size)
 +static int ocfs2_xattr_security_get(struct dentry *dentry, const char *name,
 +                                  void *buffer, size_t size, int type)
  {
        if (strcmp(name, "") == 0)
                return -EINVAL;
 -      return ocfs2_xattr_get(inode, OCFS2_XATTR_INDEX_SECURITY, name,
 -                             buffer, size);
 +      return ocfs2_xattr_get(dentry->d_inode, OCFS2_XATTR_INDEX_SECURITY,
 +                             name, buffer, size);
  }
  
 -static int ocfs2_xattr_security_set(struct inode *inode, const char *name,
 -                                  const void *value, size_t size, int flags)
 +static int ocfs2_xattr_security_set(struct dentry *dentry, const char *name,
 +              const void *value, size_t size, int flags, int type)
  {
        if (strcmp(name, "") == 0)
                return -EINVAL;
  
 -      return ocfs2_xattr_set(inode, OCFS2_XATTR_INDEX_SECURITY, name, value,
 -                             size, flags);
 +      return ocfs2_xattr_set(dentry->d_inode, OCFS2_XATTR_INDEX_SECURITY,
 +                             name, value, size, flags);
  }
  
  int ocfs2_init_security_get(struct inode *inode,
@@@ -7074,9 -7072,9 +7070,9 @@@ struct xattr_handler ocfs2_xattr_securi
  /*
   * 'trusted' attributes support
   */
 -static size_t ocfs2_xattr_trusted_list(struct inode *inode, char *list,
 +static size_t ocfs2_xattr_trusted_list(struct dentry *dentry, char *list,
                                       size_t list_size, const char *name,
 -                                     size_t name_len)
 +                                     size_t name_len, int type)
  {
        const size_t prefix_len = XATTR_TRUSTED_PREFIX_LEN;
        const size_t total_len = prefix_len + name_len + 1;
        return total_len;
  }
  
 -static int ocfs2_xattr_trusted_get(struct inode *inode, const char *name,
 -                                 void *buffer, size_t size)
 +static int ocfs2_xattr_trusted_get(struct dentry *dentry, const char *name,
 +              void *buffer, size_t size, int type)
  {
        if (strcmp(name, "") == 0)
                return -EINVAL;
 -      return ocfs2_xattr_get(inode, OCFS2_XATTR_INDEX_TRUSTED, name,
 -                             buffer, size);
 +      return ocfs2_xattr_get(dentry->d_inode, OCFS2_XATTR_INDEX_TRUSTED,
 +                             name, buffer, size);
  }
  
 -static int ocfs2_xattr_trusted_set(struct inode *inode, const char *name,
 -                                 const void *value, size_t size, int flags)
 +static int ocfs2_xattr_trusted_set(struct dentry *dentry, const char *name,
 +              const void *value, size_t size, int flags, int type)
  {
        if (strcmp(name, "") == 0)
                return -EINVAL;
  
 -      return ocfs2_xattr_set(inode, OCFS2_XATTR_INDEX_TRUSTED, name, value,
 -                             size, flags);
 +      return ocfs2_xattr_set(dentry->d_inode, OCFS2_XATTR_INDEX_TRUSTED,
 +                             name, value, size, flags);
  }
  
  struct xattr_handler ocfs2_xattr_trusted_handler = {
  /*
   * 'user' attributes support
   */
 -static size_t ocfs2_xattr_user_list(struct inode *inode, char *list,
 +static size_t ocfs2_xattr_user_list(struct dentry *dentry, char *list,
                                    size_t list_size, const char *name,
 -                                  size_t name_len)
 +                                  size_t name_len, int type)
  {
        const size_t prefix_len = XATTR_USER_PREFIX_LEN;
        const size_t total_len = prefix_len + name_len + 1;
 -      struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 +      struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb);
  
        if (osb->s_mount_opt & OCFS2_MOUNT_NOUSERXATTR)
                return 0;
        return total_len;
  }
  
 -static int ocfs2_xattr_user_get(struct inode *inode, const char *name,
 -                              void *buffer, size_t size)
 +static int ocfs2_xattr_user_get(struct dentry *dentry, const char *name,
 +              void *buffer, size_t size, int type)
  {
 -      struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 +      struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb);
  
        if (strcmp(name, "") == 0)
                return -EINVAL;
        if (osb->s_mount_opt & OCFS2_MOUNT_NOUSERXATTR)
                return -EOPNOTSUPP;
 -      return ocfs2_xattr_get(inode, OCFS2_XATTR_INDEX_USER, name,
 +      return ocfs2_xattr_get(dentry->d_inode, OCFS2_XATTR_INDEX_USER, name,
                               buffer, size);
  }
  
 -static int ocfs2_xattr_user_set(struct inode *inode, const char *name,
 -                              const void *value, size_t size, int flags)
 +static int ocfs2_xattr_user_set(struct dentry *dentry, const char *name,
 +              const void *value, size_t size, int flags, int type)
  {
 -      struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 +      struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb);
  
        if (strcmp(name, "") == 0)
                return -EINVAL;
        if (osb->s_mount_opt & OCFS2_MOUNT_NOUSERXATTR)
                return -EOPNOTSUPP;
  
 -      return ocfs2_xattr_set(inode, OCFS2_XATTR_INDEX_USER, name, value,
 -                             size, flags);
 +      return ocfs2_xattr_set(dentry->d_inode, OCFS2_XATTR_INDEX_USER,
 +                             name, value, size, flags);
  }
  
  struct xattr_handler ocfs2_xattr_user_handler = {