file.c (facb0205401a6ce4be410e1f4b9357bbc6caa36a) file.c (e9750824114ff939d9da299e73651add6aa65456)
1/*
2 * fs/f2fs/file.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/fs.h>
12#include <linux/f2fs_fs.h>
13#include <linux/stat.h>
14#include <linux/buffer_head.h>
15#include <linux/writeback.h>
16#include <linux/falloc.h>
17#include <linux/types.h>
1/*
2 * fs/f2fs/file.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/fs.h>
12#include <linux/f2fs_fs.h>
13#include <linux/stat.h>
14#include <linux/buffer_head.h>
15#include <linux/writeback.h>
16#include <linux/falloc.h>
17#include <linux/types.h>
18#include <linux/compat.h>
18#include <linux/uaccess.h>
19#include <linux/mount.h>
20
21#include "f2fs.h"
22#include "node.h"
23#include "segment.h"
24#include "xattr.h"
25#include "acl.h"

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

629 mnt_drop_write(filp->f_path.mnt);
630 return ret;
631 }
632 default:
633 return -ENOTTY;
634 }
635}
636
19#include <linux/uaccess.h>
20#include <linux/mount.h>
21
22#include "f2fs.h"
23#include "node.h"
24#include "segment.h"
25#include "xattr.h"
26#include "acl.h"

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

630 mnt_drop_write(filp->f_path.mnt);
631 return ret;
632 }
633 default:
634 return -ENOTTY;
635 }
636}
637
638#ifdef CONFIG_COMPAT
639long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
640{
641 switch (cmd) {
642 case F2FS_IOC32_GETFLAGS:
643 cmd = F2FS_IOC_GETFLAGS;
644 break;
645 case F2FS_IOC32_SETFLAGS:
646 cmd = F2FS_IOC_SETFLAGS;
647 break;
648 default:
649 return -ENOIOCTLCMD;
650 }
651 return f2fs_ioctl(file, cmd, (unsigned long) compat_ptr(arg));
652}
653#endif
654
637const struct file_operations f2fs_file_operations = {
638 .llseek = generic_file_llseek,
639 .read = do_sync_read,
640 .write = do_sync_write,
641 .aio_read = generic_file_aio_read,
642 .aio_write = generic_file_aio_write,
643 .open = generic_file_open,
644 .mmap = f2fs_file_mmap,
645 .fsync = f2fs_sync_file,
646 .fallocate = f2fs_fallocate,
647 .unlocked_ioctl = f2fs_ioctl,
655const struct file_operations f2fs_file_operations = {
656 .llseek = generic_file_llseek,
657 .read = do_sync_read,
658 .write = do_sync_write,
659 .aio_read = generic_file_aio_read,
660 .aio_write = generic_file_aio_write,
661 .open = generic_file_open,
662 .mmap = f2fs_file_mmap,
663 .fsync = f2fs_sync_file,
664 .fallocate = f2fs_fallocate,
665 .unlocked_ioctl = f2fs_ioctl,
666#ifdef CONFIG_COMPAT
667 .compat_ioctl = f2fs_compat_ioctl,
668#endif
648 .splice_read = generic_file_splice_read,
649 .splice_write = generic_file_splice_write,
650};
669 .splice_read = generic_file_splice_read,
670 .splice_write = generic_file_splice_write,
671};