Re: [RFC PATCH] lightnvm: expose configuration through sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 27, 2016 at 10:18:57AM -0700, Simon A. F. Lund wrote:
> --- a/include/linux/lightnvm.h
> +++ b/include/linux/lightnvm.h
> @@ -174,6 +174,7 @@ struct nvm_id_group {
>  	u16	cpar;
>  
>  	struct nvm_id_lp_tbl lptbl;
> +	struct kobject kobj;
>  };
>  
>  struct nvm_addr_format {
> @@ -205,6 +206,7 @@ struct nvm_target {
>  	struct list_head list;
>  	struct nvm_tgt_type *type;
>  	struct gendisk *disk;
> +	struct kobject kobj;
>  };
>  
>  struct nvm_tgt_instance {
> @@ -360,6 +362,8 @@ struct nvm_dev {
>  
>  	struct mutex mlock;
>  	spinlock_t lock;
> +
> +	struct kobject kobj;
>  };
>  
>  static inline struct ppa_addr generic_to_dev_addr(struct nvm_dev *dev,

Never use "raw" kobjects in a driver for a device.  You just guaranteed
that userspace tools will not see these devices or attributes, which
implies you didn't really test this using libudev :(

Please use real devices, attached to the real devices your disks already
have in the tree.

And are you sure you didn't just mess up your reference counting by
now having the lifecycle of these structures be dictated by the kobject?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux