51
52
#include <linux/capability.h>
52
53
#include <linux/xattr.h>
53
54
#include <linux/namei.h>
55
#include <linux/posix_acl.h>
54
56
#include <linux/security.h>
55
57
#include <linux/falloc.h>
56
58
#include <linux/fiemap.h>
203
205
struct inode *inode;
204
206
struct xfs_inode *ip = NULL;
205
xfs_acl_t *default_acl = NULL;
207
struct posix_acl *default_acl = NULL;
206
208
struct xfs_name name;
207
int (*test_default_acl)(struct inode *) = _ACL_DEFAULT_EXISTS;
211
212
* Irix uses Missed'em'V split, but doesn't want to see
212
213
* the upper 5 bits of (14bit) major.
214
if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff))
217
if (test_default_acl && test_default_acl(dir)) {
218
if (!_ACL_ALLOC(default_acl)) {
221
if (!_ACL_GET_DEFAULT(dir, default_acl)) {
222
_ACL_FREE(default_acl);
227
xfs_dentry_to_name(&name, dentry);
229
if (IS_POSIXACL(dir) && !default_acl)
230
mode &= ~current->fs->umask;
232
switch (mode & S_IFMT) {
215
if (S_ISCHR(mode) || S_ISBLK(mode)) {
216
if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff))
237
218
rdev = sysv_encode_dev(rdev);
239
error = xfs_create(XFS_I(dir), &name, mode, rdev, &ip, NULL);
242
error = xfs_mkdir(XFS_I(dir), &name, mode, &ip, NULL);
223
if (IS_POSIXACL(dir)) {
224
default_acl = xfs_get_acl(dir, ACL_TYPE_DEFAULT);
225
if (IS_ERR(default_acl))
226
return -PTR_ERR(default_acl);
229
mode &= ~current_umask();
232
xfs_dentry_to_name(&name, dentry);
233
error = xfs_create(XFS_I(dir), &name, mode, rdev, &ip, NULL);
249
234
if (unlikely(error))
250
235
goto out_free_acl;
256
241
goto out_cleanup_inode;
258
243
if (default_acl) {
259
error = _ACL_INHERIT(inode, mode, default_acl);
244
error = -xfs_inherit_acl(inode, default_acl);
260
245
if (unlikely(error))
261
246
goto out_cleanup_inode;
262
_ACL_FREE(default_acl);
247
posix_acl_release(default_acl);
419
(irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO);
403
(irix_symlink_mode ? 0777 & ~current_umask() : S_IRWXUGO);
420
404
xfs_dentry_to_name(&name, dentry);
422
406
error = xfs_symlink(XFS_I(dir), &name, symname, mode, &cip, NULL);
553
514
stat->uid = ip->i_d.di_uid;
554
515
stat->gid = ip->i_d.di_gid;
555
516
stat->ino = ip->i_ino;
557
stat->ino += mp->m_inoadd;
559
517
stat->atime = inode->i_atime;
560
518
stat->mtime.tv_sec = ip->i_d.di_mtime.t_sec;
561
519
stat->mtime.tv_nsec = ip->i_d.di_mtime.t_nsec;