1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_hard_vfp_ok } */
3 /* { dg-options "-O2 -mapcs -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16" } */
5 int inode_permission (), try_break_deleg ();
6 int mutex_lock (), mutex_unlock ();
12 struct inode
*d_inode
;
16 const struct inode_operations
*i_op
;
17 struct super_block
*i_sb
;
20 const unsigned int i_nlink
;
22 unsigned long i_state
;
27 unsigned int s_max_links
;
29 struct inode_operations
31 int (*link
) (struct dentry
*, struct inode
*, struct dentry
*);
32 } __attribute__ ((__aligned__ ((1 << 6))));
33 static inline __attribute__ ((always_inline
))
34 __attribute__ ((no_instrument_function
))
35 int may_create (struct inode
*dir
, struct dentry
*child
)
39 return inode_permission (dir
, 0x00000002 | 0x00000001);
43 vfs_link (struct dentry
*old_dentry
, struct inode
*dir
,
44 struct dentry
*new_dentry
, struct inode
**delegated_inode
)
46 struct inode
*inode
= old_dentry
->d_inode
;
47 unsigned max_links
= dir
->i_sb
->s_max_links
;
49 error
= may_create (dir
, new_dentry
);
52 mutex_lock (&inode
->i_mutex
);
53 if (inode
->i_nlink
== 0 && !(inode
->i_state
& (1 << 10)))
55 else if (max_links
&& inode
->i_nlink
>= max_links
)
59 error
= try_break_deleg (inode
, delegated_inode
);
60 error
= dir
->i_op
->link (old_dentry
, dir
, new_dentry
);
62 mutex_unlock (&inode
->i_mutex
);