Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
xattr.c File Reference
#include <linux/capability.h>
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
#include <linux/uio.h>
#include <linux/sched.h>
#include <linux/splice.h>
#include <linux/mount.h>
#include <linux/writeback.h>
#include <linux/falloc.h>
#include <linux/sort.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/security.h>
#include <cluster/masklog.h>
#include "ocfs2.h"
#include "alloc.h"
#include "blockcheck.h"
#include "dlmglue.h"
#include "file.h"
#include "symlink.h"
#include "sysfile.h"
#include "inode.h"
#include "journal.h"
#include "ocfs2_fs.h"
#include "suballoc.h"
#include "uptodate.h"
#include "buffer_head_io.h"
#include "super.h"
#include "xattr.h"
#include "refcounttree.h"
#include "acl.h"
#include "ocfs2_trace.h"

Go to the source code of this file.

Data Structures

struct  ocfs2_xattr_def_value_root
 
struct  ocfs2_xattr_bucket
 
struct  ocfs2_xattr_set_ctxt
 
struct  ocfs2_xattr_info
 
struct  ocfs2_xattr_search
 
struct  ocfs2_xa_loc_operations
 
struct  ocfs2_xa_loc
 
struct  ocfs2_rm_xattr_bucket_para
 
struct  ocfs2_xattr_tree_list
 
struct  ocfs2_xattr_tree_value_refcount_para
 
struct  ocfs2_xattr_reflink
 
struct  ocfs2_reflink_xattr_tree_args
 
struct  ocfs2_value_tree_metas
 

Macros

#define OCFS2_XATTR_ROOT_SIZE   (sizeof(struct ocfs2_xattr_def_value_root))
 
#define OCFS2_XATTR_INLINE_SIZE   80
 
#define OCFS2_XATTR_HEADER_GAP   4
 
#define OCFS2_XATTR_FREE_IN_IBODY
 
#define OCFS2_XATTR_FREE_IN_BLOCK(ptr)
 
#define bucket_blkno(_b)   ((_b)->bu_bhs[0]->b_blocknr)
 
#define bucket_block(_b, _n)   ((_b)->bu_bhs[(_n)]->b_data)
 
#define bucket_xh(_b)   ((struct ocfs2_xattr_header *)bucket_block((_b), 0))
 

Typedefs

typedef intxattr_tree_rec_func )(struct inode *inode, struct buffer_head *root_bh, u64 blkno, u32 cpos, u32 len, void *para)
 
typedef intxattr_bucket_func )(struct inode *inode, struct ocfs2_xattr_bucket *bucket, void *para)
 
typedef intshould_xattr_reflinked )(struct ocfs2_xattr_entry *xe)
 
typedef intget_xattr_value_root )(struct super_block *sb, struct buffer_head *bh, struct ocfs2_xattr_header *xh, int offset, struct ocfs2_xattr_value_root **xv, struct buffer_head **ret_bh, void *para)
 

Functions

int ocfs2_calc_security_init (struct inode *dir, struct ocfs2_security_xattr_info *si, int *want_clusters, int *xattr_credits, struct ocfs2_alloc_context **xattr_ac)
 
int ocfs2_calc_xattr_init (struct inode *dir, struct buffer_head *dir_bh, umode_t mode, struct ocfs2_security_xattr_info *si, int *want_clusters, int *xattr_credits, int *want_meta)
 
int ocfs2_has_inline_xattr_value_outside (struct inode *inode, struct ocfs2_dinode *di)
 
ssize_t ocfs2_listxattr (struct dentry *dentry, char *buffer, size_t size)
 
int ocfs2_xattr_get_nolock (struct inode *inode, struct buffer_head *di_bh, int name_index, const char *name, void *buffer, size_t buffer_size)
 
int ocfs2_xattr_remove (struct inode *inode, struct buffer_head *di_bh)
 
int ocfs2_xattr_set_handle (handle_t *handle, struct inode *inode, struct buffer_head *di_bh, int name_index, const char *name, const void *value, size_t value_len, int flags, struct ocfs2_alloc_context *meta_ac, struct ocfs2_alloc_context *data_ac)
 
int ocfs2_xattr_set (struct inode *inode, int name_index, const char *name, const void *value, size_t value_len, int flags)
 
int ocfs2_xattr_attach_refcount_tree (struct inode *inode, struct buffer_head *fe_bh, struct ocfs2_caching_info *ref_ci, struct buffer_head *ref_root_bh, struct ocfs2_cached_dealloc_ctxt *dealloc)
 
int ocfs2_reflink_xattrs (struct inode *old_inode, struct buffer_head *old_bh, struct inode *new_inode, struct buffer_head *new_bh, bool preserve_security)
 
int ocfs2_init_security_and_acl (struct inode *dir, struct inode *inode, const struct qstr *qstr)
 
int ocfs2_initxattrs (struct inode *inode, const struct xattr *xattr_array, void *fs_info)
 
int ocfs2_init_security_get (struct inode *inode, struct inode *dir, const struct qstr *qstr, struct ocfs2_security_xattr_info *si)
 
int ocfs2_init_security_set (handle_t *handle, struct inode *inode, struct buffer_head *di_bh, struct ocfs2_security_xattr_info *si, struct ocfs2_alloc_context *xattr_ac, struct ocfs2_alloc_context *data_ac)
 

Variables

struct xattr_handlerocfs2_xattr_handlers []
 
struct xattr_handler ocfs2_xattr_security_handler
 
struct xattr_handler ocfs2_xattr_trusted_handler
 
struct xattr_handler ocfs2_xattr_user_handler
 

Macro Definition Documentation

#define bucket_blkno (   _b)    ((_b)->bu_bhs[0]->b_blocknr)

Definition at line 326 of file xattr.c.

#define bucket_block (   _b,
  _n 
)    ((_b)->bu_bhs[(_n)]->b_data)

Definition at line 327 of file xattr.c.

#define bucket_xh (   _b)    ((struct ocfs2_xattr_header *)bucket_block((_b), 0))

Definition at line 328 of file xattr.c.

#define OCFS2_XATTR_FREE_IN_BLOCK (   ptr)
Value:
((ptr)->i_sb->s_blocksize \
- sizeof(struct ocfs2_xattr_block) \
- sizeof(struct ocfs2_xattr_header) \

Definition at line 91 of file xattr.c.

#define OCFS2_XATTR_FREE_IN_IBODY
Value:

Definition at line 88 of file xattr.c.

#define OCFS2_XATTR_HEADER_GAP   4

Definition at line 87 of file xattr.c.

#define OCFS2_XATTR_INLINE_SIZE   80

Definition at line 86 of file xattr.c.

#define OCFS2_XATTR_ROOT_SIZE   (sizeof(struct ocfs2_xattr_def_value_root))

Definition at line 85 of file xattr.c.

Typedef Documentation

typedef int( get_xattr_value_root)(struct super_block *sb, struct buffer_head *bh, struct ocfs2_xattr_header *xh, int offset, struct ocfs2_xattr_value_root **xv, struct buffer_head **ret_bh, void *para)

Definition at line 6182 of file xattr.c.

typedef int( should_xattr_reflinked)(struct ocfs2_xattr_entry *xe)

Definition at line 6161 of file xattr.c.

typedef int( xattr_bucket_func)(struct inode *inode, struct ocfs2_xattr_bucket *bucket, void *para)

Definition at line 3719 of file xattr.c.

typedef int( xattr_tree_rec_func)(struct inode *inode, struct buffer_head *root_bh, u64 blkno, u32 cpos, u32 len, void *para)

Definition at line 281 of file xattr.c.

Function Documentation

int ocfs2_calc_security_init ( struct inode dir,
struct ocfs2_security_xattr_info si,
int want_clusters,
int xattr_credits,
struct ocfs2_alloc_context **  xattr_ac 
)

Definition at line 586 of file xattr.c.

int ocfs2_calc_xattr_init ( struct inode dir,
struct buffer_head *  dir_bh,
umode_t  mode,
struct ocfs2_security_xattr_info si,
int want_clusters,
int xattr_credits,
int want_meta 
)

Definition at line 624 of file xattr.c.

int ocfs2_has_inline_xattr_value_outside ( struct inode inode,
struct ocfs2_dinode di 
)

Definition at line 939 of file xattr.c.

int ocfs2_init_security_and_acl ( struct inode dir,
struct inode inode,
const struct qstr qstr 
)

Definition at line 7184 of file xattr.c.

int ocfs2_init_security_get ( struct inode inode,
struct inode dir,
const struct qstr qstr,
struct ocfs2_security_xattr_info si 
)

Definition at line 7265 of file xattr.c.

int ocfs2_init_security_set ( handle_t *  handle,
struct inode inode,
struct buffer_head *  di_bh,
struct ocfs2_security_xattr_info si,
struct ocfs2_alloc_context xattr_ac,
struct ocfs2_alloc_context data_ac 
)

Definition at line 7282 of file xattr.c.

int ocfs2_initxattrs ( struct inode inode,
const struct xattr xattr_array,
void fs_info 
)

Definition at line 7249 of file xattr.c.

ssize_t ocfs2_listxattr ( struct dentry dentry,
char buffer,
size_t  size 
)

Definition at line 1010 of file xattr.c.

int ocfs2_reflink_xattrs ( struct inode old_inode,
struct buffer_head *  old_bh,
struct inode new_inode,
struct buffer_head *  new_bh,
bool  preserve_security 
)

Definition at line 7102 of file xattr.c.

int ocfs2_xattr_attach_refcount_tree ( struct inode inode,
struct buffer_head *  fe_bh,
struct ocfs2_caching_info ref_ci,
struct buffer_head *  ref_root_bh,
struct ocfs2_cached_dealloc_ctxt dealloc 
)

Definition at line 6119 of file xattr.c.

int ocfs2_xattr_get_nolock ( struct inode inode,
struct buffer_head *  di_bh,
int  name_index,
const char name,
void buffer,
size_t  buffer_size 
)

Definition at line 1260 of file xattr.c.

int ocfs2_xattr_remove ( struct inode inode,
struct buffer_head *  di_bh 
)

Definition at line 2539 of file xattr.c.

int ocfs2_xattr_set ( struct inode inode,
int  name_index,
const char name,
const void value,
size_t  value_len,
int  flags 
)

Definition at line 3504 of file xattr.c.

int ocfs2_xattr_set_handle ( handle_t *  handle,
struct inode inode,
struct buffer_head *  di_bh,
int  name_index,
const char name,
const void value,
size_t  value_len,
int  flags,
struct ocfs2_alloc_context meta_ac,
struct ocfs2_alloc_context data_ac 
)

Definition at line 3421 of file xattr.c.

Variable Documentation

struct xattr_handler* ocfs2_xattr_handlers[]
struct xattr_handler ocfs2_xattr_security_handler
Initial value:
= {
.list = ocfs2_xattr_security_list,
.get = ocfs2_xattr_security_get,
.set = ocfs2_xattr_security_set,
}

Definition at line 7295 of file xattr.c.

struct xattr_handler ocfs2_xattr_trusted_handler
Initial value:
= {
.list = ocfs2_xattr_trusted_list,
.get = ocfs2_xattr_trusted_get,
.set = ocfs2_xattr_trusted_set,
}

Definition at line 7339 of file xattr.c.

struct xattr_handler ocfs2_xattr_user_handler
Initial value:
= {
.prefix = XATTR_USER_PREFIX,
.list = ocfs2_xattr_user_list,
.get = ocfs2_xattr_user_get,
.set = ocfs2_xattr_user_set,
}

Definition at line 7395 of file xattr.c.