aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/xattr.c
AgeCommit message (Collapse)Author
2009-02-04Btrfs: join the transaction in __btrfs_setxattrJosef Bacik
With selinux on we end up calling __btrfs_setxattr when we create an inode, which calls btrfs_start_transaction(). The problem is we've already called that in btrfs_new_inode, and in btrfs_start_transaction we end up doing a wait_current_trans(). If btrfs-transaction has started committing it will wait for all handles to finish, while the other process is waiting for the transaction to commit. This is fixed by using btrfs_join_transaction, which won't wait for the transaction to commit. Thanks, Signed-off-by: Josef Bacik <jbacik@redhat.com>
2009-02-04Btrfs: selinux supportJim Owens
Add call to LSM security initialization and save resulting security xattr for new inodes. Add xattr support to symlink inode ops. Set inode->i_op for existing special files. Signed-off-by: jim owens <jowens@hp.com>
2009-01-21Btrfs: cleanup xattr codeJosef Bacik
Andrew's review of the xattr code revealed some minor issues that this patch addresses. Just an error return fix, got rid of a useless statement and commented one of the trickier parts of __btrfs_getxattr. Signed-off-by: Josef Bacik <jbacik@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-01-05Btrfs: Fix checkpatch.pl warningsChris Mason
There were many, most are fixed now. struct-funcs.c generates some warnings but these are bogus. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-12-17Btrfs: fix return value from btrfs_listxattr when buffer size is too smallYehuda Sadeh Weinraub
The return value was being overwritten. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
2008-09-25Btrfs: optimize btrget/set/removexattrChristoph Hellwig
btrfs actually stores the whole xattr name, including the prefix ondisk, so using the generic resolver that strips off the prefix is not very helpful. Instead do the real ondisk xattrs manually and only use the generic resolver for synthetic xattrs like ACLs. (Sorry Josef for guiding you towards the wrong direction here intially) Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25btrfs: optmize listxattrChristoph Hellwig
The ->list handler is really not useful at all, because we always call btrfs_xattr_generic_list anyway. After this is done find_btrfs_xattr_handler becomes unused, and it becomes obvious that the temporary name buffer allocation isn't needed but we can directly copy into the supplied buffer. Tested with various getfattr -d calls on varying xattr lists. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add ACL supportJosef Bacik
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Remove unused xattr codeJosef Bacik
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Replace the big fs_mutex with a collection of other locksChris Mason
Extent alloctions are still protected by a large alloc_mutex. Objectid allocations are covered by a objectid mutex Other btree operations are protected by a lock on individual btree nodes Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Dislable acl xattr handlersYan
The acl code is not yet complete, and the xattr handlers are causing problems for cp -p on some distros. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix compile on kernel without ACLs enabledYan
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Change magic string to reflect new formatChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Implement ACLs setting and gettingYan
ACLs are stored but not used for permission checks (yet) Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: xattr fixesJosef Bacik
This fixes two typos that Yan pointed out to me. Thanks much, Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Make ACLs return EOPNOTSUPP for nowJosef Bacik
There was a slight problem with ACL's returning EINVAL when you tried to set an ACL. This isn't correct, we should be returning EOPNOTSUPP, so I did a very ugly thing and just commented everybody out and made them return EOPNOTSUPP. This is only temporary, I'm going back to implement ACL's, but Chris wants to push out a release so this will suffice for now. Also Yan suggested setting reada to -1 in the delete case to enable backwards readahead, and in the listxattr case I moved path->reada = 2; to after the if (!path) check so we can avoid a possible null dereference. Thank you, Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25xattr support for btrfsJosef Bacik
Signed-off-by: Chris Mason <chris.mason@oracle.com>