open.c (0aea30a07ec6b50de0fc5f5b2ec34a68ead86b61) open.c (59c10c52f573faca862cda5ebcdd43831608eb5a)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/fs/open.c
4 *
5 * Copyright (C) 1991, 1992 Linus Torvalds
6 */
7
8#include <linux/string.h>

--- 210 unchanged lines hidden (view full) ---

219}
220
221SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length)
222{
223 return do_sys_ftruncate(fd, length, 0);
224}
225#endif /* BITS_PER_LONG == 32 */
226
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/fs/open.c
4 *
5 * Copyright (C) 1991, 1992 Linus Torvalds
6 */
7
8#include <linux/string.h>

--- 210 unchanged lines hidden (view full) ---

219}
220
221SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length)
222{
223 return do_sys_ftruncate(fd, length, 0);
224}
225#endif /* BITS_PER_LONG == 32 */
226
227#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_TRUNCATE64)
228COMPAT_SYSCALL_DEFINE3(truncate64, const char __user *, pathname,
229 compat_arg_u64_dual(length))
230{
231 return ksys_truncate(pathname, compat_arg_u64_glue(length));
232}
233#endif
227
234
235#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_FTRUNCATE64)
236COMPAT_SYSCALL_DEFINE3(ftruncate64, unsigned int, fd,
237 compat_arg_u64_dual(length))
238{
239 return ksys_ftruncate(fd, compat_arg_u64_glue(length));
240}
241#endif
242
228int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
229{
230 struct inode *inode = file_inode(file);
231 long ret;
232
233 if (offset < 0 || len <= 0)
234 return -EINVAL;
235

--- 98 unchanged lines hidden (view full) ---

334 return error;
335}
336
337SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
338{
339 return ksys_fallocate(fd, mode, offset, len);
340}
341
243int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
244{
245 struct inode *inode = file_inode(file);
246 long ret;
247
248 if (offset < 0 || len <= 0)
249 return -EINVAL;
250

--- 98 unchanged lines hidden (view full) ---

349 return error;
350}
351
352SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
353{
354 return ksys_fallocate(fd, mode, offset, len);
355}
356
357#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_FALLOCATE)
358COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, compat_arg_u64_dual(offset),
359 compat_arg_u64_dual(len))
360{
361 return ksys_fallocate(fd, mode, compat_arg_u64_glue(offset),
362 compat_arg_u64_glue(len));
363}
364#endif
365
342/*
343 * access() needs to use the real uid/gid, not the effective uid/gid.
344 * We do this by temporarily clearing all FS-related capabilities and
345 * switching the fsuid/fsgid around to the real ones.
346 */
347static const struct cred *access_override_creds(void)
348{
349 const struct cred *old_cred;

--- 1081 unchanged lines hidden ---
366/*
367 * access() needs to use the real uid/gid, not the effective uid/gid.
368 * We do this by temporarily clearing all FS-related capabilities and
369 * switching the fsuid/fsgid around to the real ones.
370 */
371static const struct cred *access_override_creds(void)
372{
373 const struct cred *old_cred;

--- 1081 unchanged lines hidden ---