aboutsummaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
Commit message (Expand)AuthorAge
* Remove BKL from remote_llseek v2Andi Kleen2008-07-02
* fs: use loff_t type instead of long longDavid Sterba2008-04-22
* remove the unused exports of sys_open/sys_readArjan van de Ven2008-02-08
* ext4: export iov_shorten from kernel for ext4's useEric Sandeen2008-01-28
* security: call security_file_permission from rw_verify_areaJames Morris2008-01-24
* mark sys_open/sys_read exports unusedArjan van de Ven2007-11-14
* Cleanup macros for distinguishing mandatory locksPavel Emelyanov2007-10-09
* Remove remnants of sendfile()Jens Axboe2007-07-10
* splice: divorce the splice structure/function definitions from the pipe headerJens Axboe2007-07-10
* sys_sendfile: switch to using ->splice_read, if availableJens Axboe2007-07-10
* use use SEEK_MAX to validate user lseek argumentsChris Snook2007-05-08
* use symbolic constants in generic lseek codeChris Snook2007-05-08
* [PATCH] FS: speed up rw_verify_area()Eric Dumazet2007-02-12
* [PATCH] ifdef ->rchar, ->wchar, ->syscr, ->syscw from task_structAlexey Dobriyan2007-02-11
* [PATCH] one more EXPORT_UNUSED_SYMBOL removalAdrian Bunk2006-12-13
* [PATCH] VFS: change struct file to use struct pathJosef "Jeff" Sipek2006-12-08
* [PATCH] Add vector AIO supportBadari Pulavarty2006-10-01
* [PATCH] Streamline generic_file_* interfaces and filemap cleanupsBadari Pulavarty2006-10-01
* [PATCH] Remove readv/writev methods and use aio_read/aio_write insteadBadari Pulavarty2006-10-01
* [PATCH] Vectorize aio_read/aio_write fileop methodsBadari Pulavarty2006-10-01
* [PATCH] fs/read_write.c: EXPORT_UNUSED_SYMBOLAdrian Bunk2006-07-10
* [PATCH] splice: unlikely() optimizationsJens Axboe2006-04-11
* [PATCH] Make most file operations structs in fs/ constArjan van de Ven2006-03-28
* [PATCH] remove needless check in fs/read_write.cCarsten Otte2006-03-25
* [PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_semJes Sorensen2006-01-09
* Relax the rw_verify_area() error checking.Linus Torvalds2006-01-04
* [PATCH] readv/writev syscalls are not checked by lsmKostik Belousov2005-09-29
* [PATCH] remove file.f_maxcountEric Dumazet2005-09-07
* [PATCH] inotifyRobert Love2005-07-12
* [PATCH] aio: fix do_sync_(read|write) to properly handle aio retriesBenjamin LaHaise2005-06-23
* [PATCH] undo do_readv_writev() behavior changeDave Hansen2005-04-16
* Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds2005-04-16
dt_status); wdt_startup(); return nonseekable_open(inode, file); } static ssize_t ep93xx_wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { if (len) { if (!nowayout) { size_t i; clear_bit(WDT_OK_TO_CLOSE, &wdt_status); for (i = 0; i != len; i++) { char c; if (get_user(c, data + i)) return -EFAULT; if (c == 'V') set_bit(WDT_OK_TO_CLOSE, &wdt_status); else clear_bit(WDT_OK_TO_CLOSE, &wdt_status); } } wdt_keepalive(); } return len; } static const struct watchdog_info ident = { .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE, .identity = "EP93xx Watchdog", }; static long ep93xx_wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { int ret = -ENOTTY; switch (cmd) { case WDIOC_GETSUPPORT: ret = copy_to_user((struct watchdog_info __user *)arg, &ident, sizeof(ident)) ? -EFAULT : 0; break; case WDIOC_GETSTATUS: ret = put_user(0, (int __user *)arg); break; case WDIOC_GETBOOTSTATUS: ret = put_user(boot_status, (int __user *)arg); break; case WDIOC_KEEPALIVE: wdt_keepalive(); ret = 0; break; case WDIOC_GETTIMEOUT: /* actually, it is 0.250 seconds.... */ ret = put_user(1, (int __user *)arg); break; } return ret; } static int ep93xx_wdt_release(struct inode *inode, struct file *file) { if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) wdt_shutdown(); else printk(KERN_CRIT PFX "Device closed unexpectedly - timer will not stop\n"); clear_bit(WDT_IN_USE, &wdt_status); clear_bit(WDT_OK_TO_CLOSE, &wdt_status); return 0; } static const struct file_operations ep93xx_wdt_fops = { .owner = THIS_MODULE, .write = ep93xx_wdt_write, .unlocked_ioctl = ep93xx_wdt_ioctl, .open = ep93xx_wdt_open, .release = ep93xx_wdt_release, }; static struct miscdevice ep93xx_wdt_miscdev = { .minor = WATCHDOG_MINOR, .name = "watchdog", .fops = &ep93xx_wdt_fops, }; static void ep93xx_timer_ping(unsigned long data) { if (time_before(jiffies, next_heartbeat)) wdt_ping(); /* Re-set the timer interval */ mod_timer(&timer, jiffies + WDT_INTERVAL); } static int __init ep93xx_wdt_init(void) { int err; err = misc_register(&ep93xx_wdt_miscdev); boot_status = __raw_readl(EP93XX_WDT_WATCHDOG) & 0x01 ? 1 : 0; printk(KERN_INFO PFX "EP93XX watchdog, driver version " WDT_VERSION "%s\n", (__raw_readl(EP93XX_WDT_WATCHDOG) & 0x08) ? " (nCS1 disable detected)" : ""); if (timeout < 1 || timeout > 3600) { timeout = WDT_TIMEOUT; printk(KERN_INFO PFX "timeout value must be 1<=x<=3600, using %d\n", timeout); } setup_timer(&timer, ep93xx_timer_ping, 1); return err; } static void __exit ep93xx_wdt_exit(void) { wdt_shutdown(); misc_deregister(&ep93xx_wdt_miscdev); } module_init(ep93xx_wdt_init); module_exit(ep93xx_wdt_exit); module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); module_param(timeout, int, 0); MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WDT_TIMEOUT) ")"); MODULE_AUTHOR("Ray Lehtiniemi <rayl@mail.com>," "Alessandro Zummo <a.zummo@towertech.it>"); MODULE_DESCRIPTION("EP93xx Watchdog"); MODULE_LICENSE("GPL"); MODULE_VERSION(WDT_VERSION); MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);