]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/sysfs/inode.c
sound: ASoC: Convert neo1973/lm4857 to a new-style i2c driver
[linux-2.6-omap-h63xx.git] / fs / sysfs / inode.c
index 2210cf0005fea380003100350f77080e939edc7e..eb53c632f8564a100d92e4670b8c6764776a3514 100644 (file)
@@ -1,7 +1,11 @@
 /*
- * inode.c - basic inode and dentry operations.
+ * fs/sysfs/inode.c - basic sysfs inode and dentry operations
  *
- * sysfs is Copyright (c) 2001-3 Patrick Mochel
+ * Copyright (c) 2001-3 Patrick Mochel
+ * Copyright (c) 2007 SUSE Linux Products GmbH
+ * Copyright (c) 2007 Tejun Heo <teheo@suse.de>
+ *
+ * This file is released under the GPLv2.
  *
  * Please see Documentation/filesystems/sysfs.txt for more information.
  */
@@ -20,19 +24,24 @@ extern struct super_block * sysfs_sb;
 
 static const struct address_space_operations sysfs_aops = {
        .readpage       = simple_readpage,
-       .prepare_write  = simple_prepare_write,
-       .commit_write   = simple_commit_write
+       .write_begin    = simple_write_begin,
+       .write_end      = simple_write_end,
 };
 
 static struct backing_dev_info sysfs_backing_dev_info = {
        .ra_pages       = 0,    /* No readahead */
-       .capabilities   = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK,
+       .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK,
 };
 
 static const struct inode_operations sysfs_inode_operations ={
        .setattr        = sysfs_setattr,
 };
 
+int __init sysfs_inode_init(void)
+{
+       return bdi_init(&sysfs_backing_dev_info);
+}
+
 int sysfs_setattr(struct dentry * dentry, struct iattr * iattr)
 {
        struct inode * inode = dentry->d_inode;
@@ -50,6 +59,8 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr)
        if (error)
                return error;
 
+       iattr->ia_valid &= ~ATTR_SIZE; /* ignore size changes */
+
        error = inode_setattr(inode, iattr);
        if (error)
                return error;